Skip to content

Fix ViewCube z-order, enable SD in CI, lighter background, snap CLI#200

Merged
fernandotonon merged 1 commit intomasterfrom
fix/misc-issues-2.15.1
Mar 19, 2026
Merged

Fix ViewCube z-order, enable SD in CI, lighter background, snap CLI#200
fernandotonon merged 1 commit intomasterfrom
fix/misc-issues-2.15.1

Conversation

@fernandotonon
Copy link
Owner

@fernandotonon fernandotonon commented Mar 19, 2026

Summary

  • ViewCube stays on top (Linux/Windows): Remove WindowStaysOnTopHint and lower() the window after creation on Linux and Windows. macOS already had NSWindow level lowering.
  • CI builds missing SD: Add -DENABLE_STABLE_DIFFUSION=ON to all three platform builds (Linux, macOS, Windows) in deploy.yml
  • Lighter viewport background: Changed from 0.18 to 0.27 (was too dark)
  • Snap qtmesh command not found: The snap exposes qtmesheditor.qtmesh (not bare qtmesh). Added usage docs to snap description. Users can create an alias: sudo snap alias qtmesheditor.qtmesh qtmesh
  • Version bump to 2.15.1

Test plan

  • CI: all 3 platform builds pass with SD enabled
  • Linux: ViewCube no longer floats above dialogs and other windows
  • Windows: ViewCube no longer floats above other windows
  • macOS: ViewCube behavior unchanged (already fixed)
  • Viewport background is lighter gray
  • Snap: qtmesheditor.qtmesh info model.fbx works

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Build configs now enable Stable Diffusion support on Linux and macOS.
    • CLI flags (--help/-h/--version/-v) now trigger CLI mode.
  • Bug Fixes

    • Prevented the ViewCube widget from staying on top of dialogs/windows on Linux and Windows.
  • Style

    • Darkened the 3D viewport background color.
  • Documentation

    • Added CLI usage and alias suggestion to the snap description.
  • Chores

    • Project version bumped to 2.15.1; Stable Diffusion dependency pinned to a fixed revision.

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: caea7d71-cb18-412d-bad9-710682487f5c

📥 Commits

Reviewing files that changed from the base of the PR and between b6605ab and 0427ea3.

📒 Files selected for processing (6)
  • .github/workflows/deploy.yml
  • CMakeLists.txt
  • snap/snapcraft.yaml
  • src/OgreWidget.cpp
  • src/ViewCube/ViewCubeController.cpp
  • src/main.cpp
✅ Files skipped from review due to trivial changes (2)
  • snap/snapcraft.yaml
  • src/OgreWidget.cpp
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/deploy.yml
  • CMakeLists.txt
  • src/ViewCube/ViewCubeController.cpp

📝 Walkthrough

Walkthrough

Enabled Stable Diffusion in CI for Linux and macOS, bumped project version to 2.15.1 and pinned SD dependency commit, adjusted OGRE viewport background color, changed ViewCube widget window flags on Linux/Windows, extended CLI description in snap, and expanded CLI-mode detection in startup arguments.

Changes

Cohort / File(s) Summary
CI workflow
.github/workflows/deploy.yml
Added -DENABLE_STABLE_DIFFUSION=ON to the CMake configure invocation for the Linux and macOS build jobs.
CMake project & deps
CMakeLists.txt
Bumped project version 2.15.02.15.1 (updates QTMESHEDITOR_VERSION macro). When ENABLE_STABLE_DIFFUSION is ON, switched stable_diffusion_cpp FetchContent from master to pinned commit 545fac4.
Snap metadata
snap/snapcraft.yaml
Appended a CLI subsection to the snap description with qtmesheditor.qtmesh usage and a suggested sudo snap alias qtmesheditor.qtmesh qtmesh alias.
Rendering
src/OgreWidget.cpp
Adjusted OGRE viewport background color from Ogre::ColourValue(0.18f, 0.18f, 0.18f)Ogre::ColourValue(0.118f, 0.118f, 0.118f).
Window management
src/ViewCube/ViewCubeController.cpp
On Linux and Windows, replaced Qt::Tool with `Qt::FramelessWindowHint
Startup / CLI
src/main.cpp
Expanded early CLI-mode detection to treat --help/-h and --version/-v as CLI triggers (sets cliMode = true and breaks argument scan), so those flags route to the CLI path.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

"I nibble flags and hop around,
A build flag set, a version found,
The viewport dims, the cube slips free,
CLI whispers, 'come run with me' —
A rabbit cheers: test and bound!" 🐇

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description covers the summary with bullet points for each change and includes a test plan, but does not follow the required template structure with the Features/Bugfixes sections. Reorganize the description to match the required template: group items under Features and Bugfixes sections instead of a flat bullet list to improve clarity and consistency.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes all five main changes: ViewCube z-order fix, Stable Diffusion CI enablement, lighter viewport background, snap CLI documentation, and version bump.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/misc-issues-2.15.1
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/deploy.yml:
- Line 223: The repo currently configures stable-diffusion.cpp as an unpinned
git submodule in CMakeLists (GIT_TAG master) which makes release builds
non-reproducible; update the CMake add_subdirectory or ExternalProject_Add entry
that uses GIT_TAG for stable-diffusion.cpp to reference a specific tag or commit
hash (e.g., GIT_TAG vX.Y.Z or GIT_TAG <commit-hash>) and do the same for the
llama_cpp entry that also uses GIT_TAG unpinned, ensuring the build option
ENABLE_STABLE_DIFFUSION remains unchanged but now references fixed revisions.

In `@src/ViewCube/ViewCubeController.cpp`:
- Around line 92-98: The unconditional call to raise() in
updateWidgetVisibility() undoes the intended lower() behavior applied to
m_cubeWidget on Linux/Windows; change updateWidgetVisibility() so that raise()
is only called on non-Linux/Windows builds (i.e., guard the raise() with the
same platform check used where lower() is applied), ensuring m_cubeWidget
remains lower()ed on X11/Wayland and Windows while preserving current behavior
on other platforms and when setVisible(true) triggers visibility updates.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c9c5bad4-6c5f-4c32-8fc6-fe15cd7643e8

📥 Commits

Reviewing files that changed from the base of the PR and between 35c0417 and 0c24851.

📒 Files selected for processing (5)
  • .github/workflows/deploy.yml
  • CMakeLists.txt
  • snap/snapcraft.yaml
  • src/OgreWidget.cpp
  • src/ViewCube/ViewCubeController.cpp

gcc --version
cmake --version
cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-g" -DCMAKE_C_FLAGS="-g" -DQT_QMAKE_EXECUTABLE=qmake -DCMAKE_C_COMPILER="D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/gcc.exe" -DCMAKE_CXX_COMPILER="D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/g++.exe" -DCMAKE_EXE_LINKER_FLAGS=-static -DQt6_DIR=D:/a/QtMeshEditor/Qt/${{env.QT_VERSION}}/mingw_64/lib/cmake/Qt6 -DQT_DIR=D:/a/QtMeshEditor/Qt/${{env.QT_VERSION}}/mingw_64/lib/cmake/Qt6 -DQt6GuiTools_DIR=D:/a/QtMeshEditor/Qt/${{env.QT_VERSION}}/mingw_64/lib/cmake/Qt6GuiTools -DOGRE_DIR=${{github.workspace}}/ogre-build/SDK/CMake/ -DASSIMP_DIR=C:/PROGRA~2/Assimp/lib/cmake/assimp-${{ env.ASSIMP_DIR_VERSION }}
cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-g" -DCMAKE_C_FLAGS="-g" -DENABLE_STABLE_DIFFUSION=ON -DQT_QMAKE_EXECUTABLE=qmake -DCMAKE_C_COMPILER="D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/gcc.exe" -DCMAKE_CXX_COMPILER="D:/a/QtMeshEditor/Qt/Tools/mingw1310_64/bin/g++.exe" -DCMAKE_EXE_LINKER_FLAGS=-static -DQt6_DIR=D:/a/QtMeshEditor/Qt/${{env.QT_VERSION}}/mingw_64/lib/cmake/Qt6 -DQT_DIR=D:/a/QtMeshEditor/Qt/${{env.QT_VERSION}}/mingw_64/lib/cmake/Qt6 -DQt6GuiTools_DIR=D:/a/QtMeshEditor/Qt/${{env.QT_VERSION}}/mingw_64/lib/cmake/Qt6GuiTools -DOGRE_DIR=${{github.workspace}}/ogre-build/SDK/CMake/ -DASSIMP_DIR=C:/PROGRA~2/Assimp/lib/cmake/assimp-${{ env.ASSIMP_DIR_VERSION }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm workflow enables SD and CMake fetches from an unpinned branch.
rg -n -C2 'ENABLE_STABLE_DIFFUSION=ON' .github/workflows/deploy.yml
rg -n -C4 'stable_diffusion_cpp|GIT_TAG' CMakeLists.txt

Repository: fernandotonon/QtMeshEditor

Length of output: 2867


🏁 Script executed:

# Check the full conditional block in CMakeLists.txt
sed -n '230,260p' CMakeLists.txt

# Check if stable-diffusion.cpp is properly guarded in source files
rg -n '#ifdef.*ENABLE_STABLE_DIFFUSION' --type cpp --type hpp

# Look for includes of stable-diffusion headers
rg -n '#include.*stable' --type cpp --type hpp | head -20

# Check the default state of ENABLE_STABLE_DIFFUSION option
rg -n 'option.*ENABLE_STABLE_DIFFUSION|set.*ENABLE_STABLE_DIFFUSION' CMakeLists.txt

Repository: fernandotonon/QtMeshEditor

Length of output: 1326


🏁 Script executed:

# Retry with correct syntax - search for ifdef guards
rg -n '#ifdef.*ENABLE_STABLE_DIFFUSION' 

# Search for stable-diffusion includes
rg -n '#include.*stable.*diffusion' 

# Search for usage of stable-diffusion classes/functions
rg -n 'stable_diffusion|StableDiffusion' --max-count 10

Repository: fernandotonon/QtMeshEditor

Length of output: 2556


Pin stable-diffusion.cpp revision in CMakeLists.txt before deploying with it enabled.

With deploy.yml lines 223, 491, and 1210 setting -DENABLE_STABLE_DIFFUSION=ON in release builds, the builds depend on whatever master points to at configure time. CMakeLists.txt line 244 uses GIT_TAG master without a pinned commit or release tag, making release artifacts non-reproducible and vulnerable to upstream breakage.

Change GIT_TAG master to a pinned tag or commit hash (e.g., GIT_TAG v1.2.3 or GIT_TAG abc123def456).

Note: llama_cpp at line 201 has the same unpinned dependency issue.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy.yml at line 223, The repo currently configures
stable-diffusion.cpp as an unpinned git submodule in CMakeLists (GIT_TAG master)
which makes release builds non-reproducible; update the CMake add_subdirectory
or ExternalProject_Add entry that uses GIT_TAG for stable-diffusion.cpp to
reference a specific tag or commit hash (e.g., GIT_TAG vX.Y.Z or GIT_TAG
<commit-hash>) and do the same for the llama_cpp entry that also uses GIT_TAG
unpinned, ensuring the build option ENABLE_STABLE_DIFFUSION remains unchanged
but now references fixed revisions.

Comment on lines +92 to +98
#if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
// On X11/Wayland and Windows, Qt::Tool windows stay on top of all app windows
// by default. Remove WindowStaysOnTopHint explicitly and lower the window so
// it doesn't float above dialogs, material editor, and other OS windows.
m_cubeWidget->setWindowFlags(m_cubeWidget->windowFlags() & ~Qt::WindowStaysOnTopHint);
m_cubeWidget->lower();
#endif
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the lower/raise call chain affecting ViewCube z-order.
rg -n -C3 'm_cubeWidget->(lower|raise|show)\(' src/ViewCube/ViewCubeController.cpp
rg -n -C5 'setVisible\(true\)' src/mainwindow.cpp

Repository: fernandotonon/QtMeshEditor

Length of output: 3148


Platform-conditional raise() needed in updateWidgetVisibility()—current unconditional raise() undoes the Linux/Windows z-order fix.

The lower() call at line 97 is negated when setVisible(true) is invoked (mainwindow.cpp:391), which triggers updateWidgetVisibility() to unconditionally call raise() at line 306. On Linux/Windows, this counteracts the intended behavior of keeping the widget below other application windows.

Guard the raise() call in updateWidgetVisibility() with the platform condition:

Proposed fix
 void ViewCubeController::updateWidgetVisibility()
 {
     if (isVisible()) {
         reposition();
         m_cubeWidget->show();
-        m_cubeWidget->raise();
+#if defined(Q_OS_LINUX) || defined(Q_OS_WIN)
+        m_cubeWidget->lower();
+#else
+        m_cubeWidget->raise();
+#endif
     } else {
         m_cubeWidget->hide();
     }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/ViewCube/ViewCubeController.cpp` around lines 92 - 98, The unconditional
call to raise() in updateWidgetVisibility() undoes the intended lower() behavior
applied to m_cubeWidget on Linux/Windows; change updateWidgetVisibility() so
that raise() is only called on non-Linux/Windows builds (i.e., guard the raise()
with the same platform check used where lower() is applied), ensuring
m_cubeWidget remains lower()ed on X11/Wayland and Windows while preserving
current behavior on other platforms and when setVisible(true) triggers
visibility updates.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c248512dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

run: |
sudo cmake -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DCMAKE_CXX_FLAGS="-g" -DCMAKE_C_FLAGS="-g" \
-DENABLE_STABLE_DIFFUSION=ON \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pin stable-diffusion.cpp before enabling it in deploy builds

Enabling -DENABLE_STABLE_DIFFUSION=ON here makes the release workflow pull stable-diffusion.cpp through FetchContent, and CMakeLists.txt:241-245 pins that dependency to GIT_TAG master. Because this code path was previously off in CI, the change makes Windows/Linux/macOS release builds non-reproducible: any upstream push can now break packaging or silently change shipped behavior without a corresponding change in this repo. Please pin a specific tag or commit before turning this on in deploy.yml.

Useful? React with 👍 / 👎.

Comment on lines +96 to +97
m_cubeWidget->setWindowFlags(m_cubeWidget->windowFlags() & ~Qt::WindowStaysOnTopHint);
m_cubeWidget->lower();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't rely on lower() to fix the ViewCube stacking bug

This Linux/Windows branch does not actually change the cube's z-order in the way the comment describes. The widget is created with only Qt::FramelessWindowHint | Qt::Tool, so clearing WindowStaysOnTopHint is a no-op, and m_cubeWidget is still a top-level QQuickWidget with no parent. Qt documents QWidget::lower() as only reordering a widget within its parent/sibling stack, so this call will not move the cube behind dialogs or other top-level windows; the reported always-on-top behavior can still reproduce on those platforms.

Useful? React with 👍 / 👎.

@fernandotonon fernandotonon force-pushed the fix/misc-issues-2.15.1 branch 3 times, most recently from 816f536 to b6605ab Compare March 19, 2026 13:37
- Fix ViewCube staying on top of other windows on Linux and Windows by
  removing WindowStaysOnTopHint and lowering the window after creation
- Enable ENABLE_STABLE_DIFFUSION=ON in CI deploy builds for all three
  platforms (Linux, macOS, Windows) so released binaries include SD
- Lighten viewport background from 0.18 to 0.27 (less dark)
- Document snap CLI usage in snapcraft.yaml description: users need
  qtmesheditor.qtmesh or can create an alias with sudo snap alias
- Bump version to 2.15.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fernandotonon fernandotonon force-pushed the fix/misc-issues-2.15.1 branch from b6605ab to 0427ea3 Compare March 19, 2026 14:21
@sonarqubecloud
Copy link

@fernandotonon fernandotonon merged commit c83aecb into master Mar 19, 2026
17 checks passed
@fernandotonon fernandotonon deleted the fix/misc-issues-2.15.1 branch March 19, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant