Skip to content

Fix GTK startup regressions and add opt-in Linux rendering compatibility - #964

Open
michalTargiel91 wants to merge 3 commits into
Snapmaker:mainfrom
michalTargiel91:fix/linux-startup-and-render-compat
Open

michalTargiel91 wants to merge 3 commits into
Snapmaker:mainfrom
michalTargiel91:fix/linux-startup-and-render-compat

Conversation

@michalTargiel91

Copy link
Copy Markdown

Description

On Linux/GTK, popup teardown can unbind activation handlers through an already-detached parent, WebKit bridge setup reports unsupported native-object results, and flat printer metadata updates are incorrectly validated as preset bundles. This PR fixes those paths, makes integer-coordinate line-radius queries compile reliably with Eigen/modern Clang, and adds an explicit Linux rendering fallback for blank model canvases and NVIDIA EGL crashes.

Changes:

  • Keep a weak reference to each popup's original activation emitter and unbind only while it remains alive (PopupWindow and SliceModePopup).
  • Use GTK's WebKit subclass for fire-and-forget script calls, discard completion values when no output is requested, retain normal result-returning calls, and guard missing backends/errors.
  • Distinguish flat printer metadata from preset bundles during staged updates; require a regular version.txt and at least one regular model JSON before replacement.
  • Specify the line type for distance queries and materialize the Eigen cast before constructing the radius-query distancer.
  • Treat degenerate exclusion contours as empty and reduce logging of normal resource-server lifecycle events.
  • Share certificate/locale setup between packaged launchers and a portable source-build launcher.
  • Add opt-in ORCA_LINUX_RENDER_COMPAT=1: Mesa/Zink, OpenGL 2.1, X11/XWayland, and disabled WebKit DMA-BUF. Keep existing packaged NVIDIA/Wayland detection when the option is unset.

The compatibility mode is a workaround, not a root-cause fix for the modern OpenGL canvas. It requires Mesa/Zink, a working Vulkan driver, XWayland, and the documented Mesa EGL descriptor. OpenGL 2.1 may reduce performance or disable newer rendering features. User-provided CA settings are preserved. No printing behavior is intentionally changed.

Screenshots/Recordings/Graphs

Manual comparison and reproduction instructions are in doc/Linux-render-compatibility.md. On the affected machine, default OpenGL contexts showed a blank canvas with both Zink and llvmpipe; the OpenGL 2.1 path displayed geometry and all seven plates of the same 3MF with both renderers. Zink was then verified in the normal user profile. Private desktop screenshots and local logs are not included.

Tests

  • Local Release build of Snapmaker Orca at base c0e69878c643e8f6de128da4aa40f8da84327ae7 with the C++ fixes: built successfully with Clang 22 (the installed build).
  • Fresh standalone build from this PR worktree using GCC 16.2.1: 5/5 CTest cases pass (three metadata validation cases and two line-radius cases).
  • GTK popup lifecycle smoke: parent destruction plus detached children in both destruction orders.
  • WebKit completion smoke: native-object result reproduces Unsupported result type; discarded completion returns successfully.
  • Both packaging scripts and shared/source launchers pass shell syntax checks; generated packaged launcher syntax also checked. Default rendering remains opt-in, explicit CA override is preserved, and compatibility environment settings were checked.
  • Manual rendering verification: Arch Linux, wxGTK3, WebKitGTK 4.1, NVIDIA RTX 3090 / 610.57.04, Mesa 26.2.2. WebKit core/journal identified SIGSEGV in libnvidia-eglcore. Model geometry and all seven plates visible with the compatibility settings.

Limits: sliced toolpaths, printing, Windows/macOS, other GPUs/distributions, and full AppImage packaging were not tested. GUI smoke sources are included; their API checks do not establish that the NVIDIA driver defect itself is fixed.

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