Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion backend/source/backend/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <utility/resources.hpp>
#include <version.hpp>
#include <nui/backend/filesystem/special_paths.hpp>
#include <nui/backend/webkit_gtk_rendering.hpp>

#include <nui/core.hpp>
#include <nui/rpc.hpp>
Expand Down Expand Up @@ -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<void>(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<std::size_t>(argc)} | std::views::drop(1);
Expand Down Expand Up @@ -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");
Expand All @@ -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();
}
Expand Down
Loading