From 48ba9f6d82d89f70d2230b4b3204c52a5fb7b263 Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Sun, 22 Dec 2024 16:28:09 -0600 Subject: [PATCH] nonguix: chromium-binary-build-system: Hint Electron Ozone Platform * (nonguix build chromium-binary-build-system): Export the ELECTRON_OZONE_PLATFORM_HINT environment variable in the wrapper script created by the build system's wrap-program invocation. This should allow Electron apps to detect whether they are running on Wayland or X11. If they are on Wayland, then they should default to using Wayland libraries. This should help with HiDPI monitors, fractional scaling, and all the other issues that Wayland solved over X11. This environment variable is only supported by Electron versions >=28. All earlier versions relied on command-line arguments instead. --- nonguix/build/chromium-binary-build-system.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nonguix/build/chromium-binary-build-system.scm b/nonguix/build/chromium-binary-build-system.scm index 8429742..6d5eeb2 100644 --- a/nonguix/build/chromium-binary-build-system.scm +++ b/nonguix/build/chromium-binary-build-system.scm @@ -52,7 +52,12 @@ (list (string-append nss "/lib/nss") output)) - ":"))))) + ":"))) + ;; Give a hint to Electron-based apps to detect if Wayland or X11 should + ;; be used. + ;; NOTE: The env-var version of this CLI arg was added in Electron >=28 + `("ELECTRON_OZONE_PLATFORM_HINT" ":" = + ("auto")))) (map (lambda (exe) (string-append bin "/" exe)) (filter