Use fallback-x11 and disable WebKit compositing on Wayland

This commit is contained in:
SoftFever
2026-06-21 21:11:37 +08:00
parent 6d9eb1792f
commit f9693c4c96
2 changed files with 8 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ build-options:
LDFLAGS: "-fuse-ld=lld" LDFLAGS: "-fuse-ld=lld"
finish-args: finish-args:
- --share=ipc - --share=ipc
- --socket=x11 - --socket=fallback-x11
- --socket=wayland - --socket=wayland
- --share=network - --share=network
- --device=all - --device=all

View File

@@ -1267,15 +1267,15 @@ int CLI::run(int argc, char **argv)
} }
#endif #endif
// WebKit2GTK compositing can fail under XWayland on older // WebKit2GTK accelerated compositing is unreliable on Wayland: we
// WebKit releases. Disable it only when both DISPLAY and // observed blank/garbled web views (Home/Device) with both NVIDIA
// WAYLAND_DISPLAY are set (i.e. an XWayland session is in // and AMD drivers. Disable it whenever WAYLAND_DISPLAY is set
// use). On pure X11 or native Wayland, compositing is left // (covers native Wayland and XWayland); must happen before the first
// enabled so WebKit retains HW acceleration. // web view is created. Pure X11 (DISPLAY only, no WAYLAND_DISPLAY)
// and the GDK_BACKEND=x11 opt-in path above keep it enabled.
{ {
const char* display_env_wk = ::getenv("DISPLAY");
const char* wayland_env_wk = ::getenv("WAYLAND_DISPLAY"); const char* wayland_env_wk = ::getenv("WAYLAND_DISPLAY");
if (display_env_wk && *display_env_wk && wayland_env_wk && *wayland_env_wk) { if (wayland_env_wk && *wayland_env_wk) {
::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "1", /* replace */ false); ::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "1", /* replace */ false);
} }
} }