Use WebKit's Shared-Memory Transport on Wayland Outside the Flatpak (#17399)

* Use WebKit's shared-memory transport on Wayland outside the Flatpak

In a Wayland session, the hardware DMABUF path of Ubuntu's WebKitGTK 2.52
on Intel GPUs froze the Preview, Device and Project tabs and left the 3D
view drawn over other pages. On the default path of a build with EGL,
outside the Flatpak, set WEBKIT_DMABUF_RENDERER_FORCE_SHM=1, as Orca
already does for NVIDIA and virtual machines, so compositing stays on.
WebKitGTK 2.42 and 2.43 have the DMABUF renderer but ignore that switch,
so they get WEBKIT_DISABLE_COMPOSITING_MODE=1 instead. The Flatpak's
runtime WebKitGTK works, so it keeps the hardware path.

A Wayland session is detected by wayland_socket_available(), which looks
for the socket the way wl_display_connect(NULL) does. The no-EGL fallback
and the GUI start-up check use it too, so all three agree with GTK.
is_running_in_flatpak() checks only /.flatpak-info, because a host process
started from a Flatpak can inherit FLATPAK_ID; the data-dir migration and
the Troubleshoot dialog now use it. Both helpers live in libslic3r/Utils
and have unit tests.

Fixes #17381

* Note that Debian's WebKitGTK 2.54 on AMD freezes too

(cherry picked from commit bf1fb93b78)
This commit is contained in:
Kris Austin authored and HanifKoh committed 2026-11-21 15:42:06 +08:00
1 parent 08d0b874bb
commit 3de993481e
9 files changed
+202 -50

No files matched your search

+1 -1
View File
@@ -593,7 +593,7 @@ private:
#ifdef __linux__
static void migrate_flatpak_legacy_datadir(const boost::filesystem::path &data_dir_path)
{
if(!boost::filesystem::exists("/.flatpak-info"))
if (!is_running_in_flatpak())
return; // Not running as a Flatpak, nothing to migrate.
namespace fs = boost::filesystem;