From 0c083d7ada2af3e1f366018deb586f5a2ccf754b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 15 May 2020 12:45:02 +0200 Subject: [PATCH] Use D-Bus remote on Wayland (rhbz#1817330) --- thunderbird-dbus-remote.patch | 43 +++++++++++++++++++++++++++++++++++ thunderbird.sh.in | 7 ++++++ thunderbird.spec | 7 +++++- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 thunderbird-dbus-remote.patch diff --git a/thunderbird-dbus-remote.patch b/thunderbird-dbus-remote.patch new file mode 100644 index 0000000..6142e1e --- /dev/null +++ b/thunderbird-dbus-remote.patch @@ -0,0 +1,43 @@ +diff --git a/toolkit/components/remote/nsRemoteService.cpp b/toolkit/components/remote/nsRemoteService.cpp +--- a/toolkit/components/remote/nsRemoteService.cpp ++++ b/toolkit/components/remote/nsRemoteService.cpp +@@ -38,6 +38,10 @@ + #define START_TIMEOUT_SEC 5 + #define START_SLEEP_MSEC 100 + ++// When MOZ_DBUS_REMOTE is set both X11 and Wayland backends ++// use only DBus remote. ++#define DBUS_REMOTE_ENV "MOZ_DBUS_REMOTE" ++ + using namespace mozilla; + + extern int gArgc; +@@ -101,11 +105,11 @@ + bool useX11Remote = GDK_IS_X11_DISPLAY(gdk_display_get_default()); + + # if defined(MOZ_ENABLE_DBUS) +- if (!useX11Remote) { ++ if (!useX11Remote || getenv(DBUS_REMOTE_ENV)) { + client = new nsDBusRemoteClient(); + } + # endif +- if (useX11Remote) { ++ if (!client && useX11Remote) { + client = new nsXRemoteClient(); + } + #elif defined(XP_WIN) +@@ -150,11 +154,11 @@ + bool useX11Remote = GDK_IS_X11_DISPLAY(gdk_display_get_default()); + + # if defined(MOZ_ENABLE_DBUS) +- if (!useX11Remote) { ++ if (!useX11Remote || getenv(DBUS_REMOTE_ENV)) { + mRemoteServer = MakeUnique(); + } + # endif +- if (useX11Remote) { ++ if (!mRemoteServer && useX11Remote) { + mRemoteServer = MakeUnique(); + } + #elif defined(XP_WIN) + diff --git a/thunderbird.sh.in b/thunderbird.sh.in index 110ead1..a4173d6 100644 --- a/thunderbird.sh.in +++ b/thunderbird.sh.in @@ -74,6 +74,13 @@ export MOZ_ALLOW_DOWNGRADE=1 # export MOZ_DISABLE_LANGPACKS # +## +## Use D-Bus remote exclusively when there's Wayland display. +## +if [ "$WAYLAND_DISPLAY" ]; then + export MOZ_DBUS_REMOTE=1 +fi + ## ## Automatically installed langpacks are tracked by .fedora-langpack-install ## config file. diff --git a/thunderbird.spec b/thunderbird.spec index 950c032..45c04d2 100644 --- a/thunderbird.spec +++ b/thunderbird.spec @@ -94,7 +94,7 @@ ExcludeArch: s390x Summary: Mozilla Thunderbird mail/newsgroup client Name: thunderbird Version: 68.8.0 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.mozilla.org/projects/thunderbird/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: ftp://ftp.mozilla.org/pub/thunderbird/releases/%{version}%{?pre_version}/source/thunderbird-%{version}%{?pre_version}.source.tar.xz @@ -139,6 +139,7 @@ Patch307: build-disable-elfhack.patch # Upstream patches Patch402: mozilla-526293.patch Patch403: mozilla-1576268.patch +Patch404: thunderbird-dbus-remote.patch %if %{official_branding} # Required by Mozilla Corporation @@ -285,6 +286,7 @@ debug %{name}, you want to install %{name}-debuginfo instead. %patch402 -p1 -b .526293 %patch403 -p1 -b .1576268 +%patch404 -p1 -b .thunderbird-dbus-remote %if %{official_branding} # Required by Mozilla Corporation @@ -759,6 +761,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #=============================================================================== %changelog +* Fri May 15 2020 Martin Stransky - 68.8.0-2 +- Use D-Bus remote on Wayland (rhbz#1817330). + * Thu May 14 2020 Jan Horak - 68.8.0-1 - Update to 68.8.0 build2