wrapFirefox: support GDK_BACKEND=wayland
The firefox wrapper now supports setting the GDK_BACKEND to wayland which is useful in cases where firefox would be started from within an X-Application inside of wayland. GTK/GDK would otherwise default to the X11 backend in those situations. The intention is that people that are using wayland primarily pull in the new `firefox-wayland` top-level attribute into their environments instead of just `firefox`. Firefox will then always be started with the correct rendering backend.
This commit is contained in:
parent
d7731c3142
commit
7eaef48e5a
@ -26,8 +26,11 @@ let
|
|||||||
, icon ? browserName
|
, icon ? browserName
|
||||||
, extraPlugins ? []
|
, extraPlugins ? []
|
||||||
, extraNativeMessagingHosts ? []
|
, extraNativeMessagingHosts ? []
|
||||||
|
, gdkWayland ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert gdkWayland -> (browser ? gtk3); # Can only use the wayland backend if gtk3 is being used
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.${browserName} or {};
|
cfg = config.${browserName} or {};
|
||||||
enableAdobeFlash = cfg.enableAdobeFlash or false;
|
enableAdobeFlash = cfg.enableAdobeFlash or false;
|
||||||
@ -86,7 +89,7 @@ let
|
|||||||
exec = "${browserName}${nameSuffix} %U";
|
exec = "${browserName}${nameSuffix} %U";
|
||||||
inherit icon;
|
inherit icon;
|
||||||
comment = "";
|
comment = "";
|
||||||
desktopName = "${desktopName}${nameSuffix}";
|
desktopName = "${desktopName}${nameSuffix}${lib.optionalString gdkWayland " (Wayland)"}";
|
||||||
genericName = "Web Browser";
|
genericName = "Web Browser";
|
||||||
categories = "Application;Network;WebBrowser;";
|
categories = "Application;Network;WebBrowser;";
|
||||||
mimeType = stdenv.lib.concatStringsSep ";" [
|
mimeType = stdenv.lib.concatStringsSep ";" [
|
||||||
@ -124,7 +127,9 @@ let
|
|||||||
--suffix PATH ':' "$out${browser.execdir or "/bin"}" \
|
--suffix PATH ':' "$out${browser.execdir or "/bin"}" \
|
||||||
--set MOZ_APP_LAUNCHER "${browserName}${nameSuffix}" \
|
--set MOZ_APP_LAUNCHER "${browserName}${nameSuffix}" \
|
||||||
--set MOZ_SYSTEM_DIR "$out/lib/mozilla" \
|
--set MOZ_SYSTEM_DIR "$out/lib/mozilla" \
|
||||||
${lib.optionalString (browser ? gtk3)
|
${lib.optionalString gdkWayland ''
|
||||||
|
--set GDK_BACKEND "wayland" \
|
||||||
|
''}${lib.optionalString (browser ? gtk3)
|
||||||
''--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
|
''--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
|
||||||
--suffix XDG_DATA_DIRS : '${gnome3.defaultIconTheme}/share'
|
--suffix XDG_DATA_DIRS : '${gnome3.defaultIconTheme}/share'
|
||||||
''
|
''
|
||||||
|
@ -17164,6 +17164,7 @@ with pkgs;
|
|||||||
icecat-unwrapped = firefoxPackages.icecat;
|
icecat-unwrapped = firefoxPackages.icecat;
|
||||||
|
|
||||||
firefox = wrapFirefox firefox-unwrapped { };
|
firefox = wrapFirefox firefox-unwrapped { };
|
||||||
|
firefox-wayland = wrapFirefox firefox-unwrapped { gdkWayland = true; };
|
||||||
firefox-esr-52 = wrapFirefox firefox-esr-52-unwrapped { };
|
firefox-esr-52 = wrapFirefox firefox-esr-52-unwrapped { };
|
||||||
firefox-esr-60 = wrapFirefox firefox-esr-60-unwrapped { };
|
firefox-esr-60 = wrapFirefox firefox-esr-60-unwrapped { };
|
||||||
firefox-esr = firefox-esr-60;
|
firefox-esr = firefox-esr-60;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user