diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e5cbd57e..a958f7af 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -196,9 +196,10 @@ Two caveats worth knowing about: handle SIGXCPU nostop noprint pass ``` -- On some WebKitGTK driver setups the DMABUF renderer crashes the webview. - Export `WEBKIT_DISABLE_DMABUF_RENDERER=1` before launching if you see GPU - process failures. +- The WebKitGTK DMABUF renderer is disabled at startup unless every GPU uses + amdgpu, i915 or xe (see `Nui::configureWebKitGtkRendering`), the log states + why. Export `WEBKIT_DISABLE_DMABUF_RENDERER=0` to force it on or `=1` to + force it off. Test binaries live under `build/clang_debug/test/` and can be launched the same way. diff --git a/backend/source/backend/main.cpp b/backend/source/backend/main.cpp index 1d1b6c14..b459c268 100644 --- a/backend/source/backend/main.cpp +++ b/backend/source/backend/main.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -467,6 +468,8 @@ int main(int const argc, char const* const* argv) { // Reading the umask changes it for a moment on macOS, so it is read before any thread creates files. static_cast(Utility::processUmask()); + // Before any thread exists, it uses setenv. + const auto webKitGtkRendering = Nui::configureWebKitGtkRendering(); #ifdef _WIN32 // A GUI program has no console; --console, the help and parse errors write to the one it was started from. const auto arguments = std::span{argv, static_cast(argc)} | std::views::drop(1); @@ -532,7 +535,6 @@ int main(int const argc, char const* const* argv) #endif #ifdef __linux__ - setenv("WEBKIT_DISABLE_DMABUF_RENDERER", "1", 0); // GTK 4 does not take it from argv like GTK 3, it names the X11 WM_CLASS and the Wayland app id. // In a flatpak WebKit has to use the app id, the portal refuses to spawn its sandboxed web process otherwise. const char* const flatpakApplicationId = std::getenv("FLATPAK_ID"); @@ -543,6 +545,8 @@ int main(int const argc, char const* const* argv) { Main m{std::move(*options), forkPoolPtr}; + if (webKitGtkRendering.decision != Nui::DmabufRendererDecision::NotApplicable) + Log::info("WebKitGTK DMA-BUF renderer: {}", webKitGtkRendering.reason); m.startChildSignalTimer(); m.show(); } diff --git a/dependencies/Nui b/dependencies/Nui index 49b826d7..e827505d 160000 --- a/dependencies/Nui +++ b/dependencies/Nui @@ -1 +1 @@ -Subproject commit 49b826d7d2b21c21c86e41f93bd2fdad51aca39e +Subproject commit e827505da1c088910573951d3d0cc9f0b4410711