From d96601547dc1b054f405b8e530a3d7cf58be410f Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 5 Feb 2019 21:34:04 +0100 Subject: [PATCH] Use MOZ_ENABLE_WAYLAND for Wayland launcher --- mozilla-1522780.patch | 42 +++++++++++++++++++++++++++++++++++++++ thunderbird-wayland.sh.in | 7 ++++++- thunderbird.sh.in | 7 ------- thunderbird.spec | 7 ++++++- 4 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 mozilla-1522780.patch diff --git a/mozilla-1522780.patch b/mozilla-1522780.patch new file mode 100644 index 0000000..701f43b --- /dev/null +++ b/mozilla-1522780.patch @@ -0,0 +1,42 @@ +diff -up thunderbird-60.5.0/toolkit/xre/nsAppRunner.cpp.1522780 thunderbird-60.5.0/toolkit/xre/nsAppRunner.cpp +--- thunderbird-60.5.0/toolkit/xre/nsAppRunner.cpp.1522780 2019-02-05 20:57:28.384820067 +0100 ++++ thunderbird-60.5.0/toolkit/xre/nsAppRunner.cpp 2019-02-05 21:05:27.623511428 +0100 +@@ -3872,10 +3872,26 @@ int XREMain::XRE_mainStartup(bool* aExit + saveDisplayArg = true; + } + +- // On Wayland disabled builds read X11 DISPLAY env exclusively +- // and don't care about different displays. +-#if !defined(MOZ_WAYLAND) +- if (!display_name) { ++ bool disableWayland = true; ++#if defined(MOZ_WAYLAND) ++ // Make X11 backend the default one. ++ // Enable Wayland backend only when GDK_BACKEND is set and ++ // Gtk+ >= 3.22 where we can expect recent enough ++ // compositor & libwayland interface. ++ disableWayland = (PR_GetEnv("GDK_BACKEND") == nullptr) || ++ (gtk_check_version(3, 22, 0) != nullptr); ++ // Enable Wayland on Gtk+ >= 3.22 where we can expect recent enough ++ disableWayland = (gtk_check_version(3, 22, 0) != nullptr); ++ if (!disableWayland) { ++ // Make X11 backend the default one unless MOZ_ENABLE_WAYLAND or ++ // GDK_BACKEND are specified. ++ disableWayland = (PR_GetEnv("GDK_BACKEND") == nullptr) && ++ (PR_GetEnv("MOZ_ENABLE_WAYLAND") == nullptr); ++ } ++#endif ++ // On Wayland disabled builds read X11 DISPLAY env exclusively ++ // and don't care about different displays. ++ if (disableWayland && !display_name) { + display_name = PR_GetEnv("DISPLAY"); + if (!display_name) { + PR_fprintf(PR_STDERR, +@@ -3883,7 +3899,6 @@ int XREMain::XRE_mainStartup(bool* aExit + return 1; + } + } +-#endif + + if (display_name) { + mGdkDisplay = gdk_display_open(display_name); diff --git a/thunderbird-wayland.sh.in b/thunderbird-wayland.sh.in index 0bbbd9c..6eb8f7f 100644 --- a/thunderbird-wayland.sh.in +++ b/thunderbird-wayland.sh.in @@ -3,5 +3,10 @@ # Run Thunderbird under Wayland # -export GDK_BACKEND=wayland +## +## Enable Wayland backend? +## +if [ "$XDG_CURRENT_DESKTOP" == "GNOME" ]; then + export MOZ_ENABLE_WAYLAND=1 +fi exec /usr/bin/thunderbird "$@" diff --git a/thunderbird.sh.in b/thunderbird.sh.in index c178d2f..b0ff04d 100644 --- a/thunderbird.sh.in +++ b/thunderbird.sh.in @@ -36,13 +36,6 @@ MOZ_LANGPACKS_DIR="$MOZ_DIST_BIN/langpacks" MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{3550f703-e582-4d05-9a08-453d09bdfdc6}" MOZ_LAUNCHER="$MOZ_DIST_BIN/thunderbird" -## -## Enable X11 backend by default? -## -if ! [ "$GDK_BACKEND" ]; then - export GDK_BACKEND=x11 -fi - ## ## Set MOZ_ENABLE_PANGO is no longer used because Pango is enabled by default ## you may use MOZ_DISABLE_PANGO=1 to force disabling of pango diff --git a/thunderbird.spec b/thunderbird.spec index d8f5fed..457e607 100644 --- a/thunderbird.spec +++ b/thunderbird.spec @@ -82,7 +82,7 @@ Summary: Mozilla Thunderbird mail/newsgroup client Name: thunderbird Version: 60.5.0 -Release: 3%{?dist} +Release: 4%{?dist} URL: http://www.mozilla.org/projects/thunderbird/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Group: Applications/Internet @@ -122,6 +122,7 @@ Patch309: mozilla-1460871-ldap-query.patch # Fedora specific patches Patch311: firefox-wayland.patch +Patch312: mozilla-1522780.patch # Upstream patches @@ -256,6 +257,7 @@ debug %{name}, you want to install %{name}-debuginfo instead. #cd .. %patch311 -p1 -b .wayland +%patch312 -p1 -b .1522780 %if %{official_branding} # Required by Mozilla Corporation @@ -676,6 +678,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #=============================================================================== %changelog +* Tue Feb 05 2019 Martin Stransky - 60.5.0-4 +- Use MOZ_ENABLE_WAYLAND for Wayland launcher. + * Tue Feb 05 2019 Martin Stransky - 60.5.0-3 - Updated Wayland patches