189 lines
7.9 KiB
Diff
189 lines
7.9 KiB
Diff
diff -up thunderbird-60.3.0/toolkit/components/remote/nsDBusRemoteService.cpp.old thunderbird-60.3.0/toolkit/components/remote/nsDBusRemoteService.cpp
|
|
--- thunderbird-60.3.0/toolkit/components/remote/nsDBusRemoteService.cpp.old 2018-10-30 12:45:34.000000000 +0100
|
|
+++ thunderbird-60.3.0/toolkit/components/remote/nsDBusRemoteService.cpp 2018-11-14 13:37:32.223714689 +0100
|
|
@@ -174,6 +174,7 @@ nsDBusRemoteService::Startup(const char*
|
|
return NS_ERROR_FAILURE;
|
|
}
|
|
dbus_connection_set_exit_on_disconnect(mConnection, false);
|
|
+ dbus_connection_setup_with_g_main(mConnection, nullptr);
|
|
|
|
mAppName = aAppName;
|
|
ToLowerCase(mAppName);
|
|
diff -up thunderbird-60.3.0/toolkit/components/remote/nsRemoteService.cpp.old thunderbird-60.3.0/toolkit/components/remote/nsRemoteService.cpp
|
|
--- thunderbird-60.3.0/toolkit/components/remote/nsRemoteService.cpp.old 2018-11-20 10:55:35.584756422 +0100
|
|
+++ thunderbird-60.3.0/toolkit/components/remote/nsRemoteService.cpp 2018-11-14 13:37:32.244714628 +0100
|
|
@@ -34,20 +34,18 @@ NS_IMPL_ISUPPORTS(nsRemoteService,
|
|
NS_IMETHODIMP
|
|
nsRemoteService::Startup(const char* aAppName, const char* aProfileName)
|
|
{
|
|
-#if 0
|
|
+#if defined(MOZ_ENABLE_DBUS) && defined(MOZ_WAYLAND)
|
|
nsresult rv;
|
|
mDBusRemoteService = new nsDBusRemoteService();
|
|
rv = mDBusRemoteService->Startup(aAppName, aProfileName);
|
|
if (NS_FAILED(rv)) {
|
|
mDBusRemoteService = nullptr;
|
|
}
|
|
+#elif !defined(MOZ_WAYLAND)
|
|
+ mGtkRemoteService = new nsGTKRemoteService();
|
|
+ mGtkRemoteService->Startup(aAppName, aProfileName);
|
|
#endif
|
|
|
|
- if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
|
- mGtkRemoteService = new nsGTKRemoteService();
|
|
- mGtkRemoteService->Startup(aAppName, aProfileName);
|
|
- }
|
|
-
|
|
if (!mDBusRemoteService && !mGtkRemoteService)
|
|
return NS_ERROR_FAILURE;
|
|
|
|
@@ -73,7 +71,7 @@ nsRemoteService::RegisterWindow(mozIDOMW
|
|
NS_IMETHODIMP
|
|
nsRemoteService::Shutdown()
|
|
{
|
|
-#if defined(MOZ_ENABLE_DBUS)
|
|
+#if defined(MOZ_ENABLE_DBUS) && defined(MOZ_WAYLAND)
|
|
if (mDBusRemoteService) {
|
|
mDBusRemoteService->Shutdown();
|
|
mDBusRemoteService = nullptr;
|
|
diff -up thunderbird-60.3.0/toolkit/components/remote/nsXRemoteService.cpp.old thunderbird-60.3.0/toolkit/components/remote/nsXRemoteService.cpp
|
|
--- thunderbird-60.3.0/toolkit/components/remote/nsXRemoteService.cpp.old 2018-10-30 12:45:34.000000000 +0100
|
|
+++ thunderbird-60.3.0/toolkit/components/remote/nsXRemoteService.cpp 2018-10-31 01:08:14.000000000 +0100
|
|
@@ -192,5 +192,5 @@ nsXRemoteService::EnsureAtoms(void)
|
|
sMozUserAtom = XAtoms[i++];
|
|
sMozProfileAtom = XAtoms[i++];
|
|
sMozProgramAtom = XAtoms[i++];
|
|
- sMozCommandLineAtom = XAtoms[i++];
|
|
+ sMozCommandLineAtom = XAtoms[i];
|
|
}
|
|
diff -up thunderbird-60.3.0/widget/xremoteclient/DBusRemoteClient.cpp.old thunderbird-60.3.0/widget/xremoteclient/DBusRemoteClient.cpp
|
|
--- thunderbird-60.3.0/widget/xremoteclient/DBusRemoteClient.cpp.old 2018-10-30 12:45:35.000000000 +0100
|
|
+++ thunderbird-60.3.0/widget/xremoteclient/DBusRemoteClient.cpp 2018-11-14 13:37:32.224714686 +0100
|
|
@@ -12,6 +12,7 @@
|
|
#include "mozilla/Base64.h"
|
|
#include "nsPrintfCString.h"
|
|
|
|
+#include <dbus/dbus-glib-lowlevel.h>
|
|
#include <dlfcn.h>
|
|
|
|
using mozilla::LogLevel;
|
|
@@ -43,6 +44,7 @@ DBusRemoteClient::Init()
|
|
return NS_ERROR_FAILURE;
|
|
|
|
dbus_connection_set_exit_on_disconnect(mConnection, false);
|
|
+ dbus_connection_setup_with_g_main(mConnection, nullptr);
|
|
|
|
return NS_OK;
|
|
}
|
|
diff -up thunderbird-60.3.0/widget/xremoteclient/DBusRemoteClient.h.old thunderbird-60.3.0/widget/xremoteclient/DBusRemoteClient.h
|
|
diff -up thunderbird-60.3.0/widget/xremoteclient/moz.build.old thunderbird-60.3.0/widget/xremoteclient/moz.build
|
|
--- thunderbird-60.3.0/widget/xremoteclient/moz.build.old 2018-10-31 01:08:14.000000000 +0100
|
|
+++ thunderbird-60.3.0/widget/xremoteclient/moz.build 2018-11-14 13:37:32.244714628 +0100
|
|
@@ -11,7 +11,6 @@ FINAL_LIBRARY = 'xul'
|
|
|
|
SOURCES += [
|
|
'RemoteUtils.cpp',
|
|
- 'XRemoteClient.cpp',
|
|
]
|
|
|
|
if CONFIG['MOZ_ENABLE_DBUS'] and CONFIG['MOZ_WAYLAND']:
|
|
@@ -20,3 +19,7 @@ if CONFIG['MOZ_ENABLE_DBUS'] and CONFIG[
|
|
]
|
|
CXXFLAGS += CONFIG['TK_CFLAGS']
|
|
CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
|
|
+else:
|
|
+ SOURCES += [
|
|
+ 'XRemoteClient.cpp',
|
|
+ ]
|
|
diff -up thunderbird-60.3.0/widget/xremoteclient/XRemoteClient.cpp.old thunderbird-60.3.0/widget/xremoteclient/XRemoteClient.cpp
|
|
--- thunderbird-60.3.0/widget/xremoteclient/XRemoteClient.cpp.old 2018-10-30 12:45:37.000000000 +0100
|
|
+++ thunderbird-60.3.0/widget/xremoteclient/XRemoteClient.cpp 2018-10-31 01:08:15.000000000 +0100
|
|
@@ -9,6 +9,7 @@
|
|
#include "mozilla/ArrayUtils.h"
|
|
#include "mozilla/IntegerPrintfMacros.h"
|
|
#include "mozilla/Sprintf.h"
|
|
+#include "mozilla/Unused.h"
|
|
#include "XRemoteClient.h"
|
|
#include "RemoteUtils.h"
|
|
#include "plstr.h"
|
|
@@ -41,7 +42,7 @@
|
|
#else
|
|
#define TO_LITTLE_ENDIAN32(x) (x)
|
|
#endif
|
|
-
|
|
+
|
|
#ifndef MAX_PATH
|
|
#ifdef PATH_MAX
|
|
#define MAX_PATH PATH_MAX
|
|
@@ -51,6 +52,7 @@
|
|
#endif
|
|
|
|
using mozilla::LogLevel;
|
|
+using mozilla::Unused;
|
|
|
|
static mozilla::LazyLogModule sRemoteLm("XRemoteClient");
|
|
|
|
@@ -118,7 +120,7 @@ XRemoteClient::Init()
|
|
mMozUserAtom = XAtoms[i++];
|
|
mMozProfileAtom = XAtoms[i++];
|
|
mMozProgramAtom = XAtoms[i++];
|
|
- mMozCommandLineAtom = XAtoms[i++];
|
|
+ mMozCommandLineAtom = XAtoms[i];
|
|
|
|
mInitialized = true;
|
|
|
|
@@ -472,12 +474,12 @@ XRemoteClient::FindBestWindow(const char
|
|
// pass in a program name and this window doesn't support that
|
|
// protocol, we don't include it in our list.
|
|
if (aProgram && strcmp(aProgram, "any")) {
|
|
- status = XGetWindowProperty(mDisplay, w, mMozProgramAtom,
|
|
- 0, (65536 / sizeof(long)),
|
|
- False, XA_STRING,
|
|
- &type, &format, &nitems, &bytesafter,
|
|
- &data_return);
|
|
-
|
|
+ Unused << XGetWindowProperty(mDisplay, w, mMozProgramAtom,
|
|
+ 0, (65536 / sizeof(long)),
|
|
+ False, XA_STRING,
|
|
+ &type, &format, &nitems, &bytesafter,
|
|
+ &data_return);
|
|
+
|
|
// If the return name is not the same as what someone passed in,
|
|
// we don't want this window.
|
|
if (data_return) {
|
|
@@ -507,11 +509,11 @@ XRemoteClient::FindBestWindow(const char
|
|
}
|
|
|
|
if (username) {
|
|
- status = XGetWindowProperty(mDisplay, w, mMozUserAtom,
|
|
- 0, (65536 / sizeof(long)),
|
|
- False, XA_STRING,
|
|
- &type, &format, &nitems, &bytesafter,
|
|
- &data_return);
|
|
+ Unused << XGetWindowProperty(mDisplay, w, mMozUserAtom,
|
|
+ 0, (65536 / sizeof(long)),
|
|
+ False, XA_STRING,
|
|
+ &type, &format, &nitems, &bytesafter,
|
|
+ &data_return);
|
|
|
|
// if there's a username compare it with what we have
|
|
if (data_return) {
|
|
@@ -529,11 +531,11 @@ XRemoteClient::FindBestWindow(const char
|
|
// there is, then we need to make sure it matches what someone
|
|
// passed in.
|
|
if (aProfile) {
|
|
- status = XGetWindowProperty(mDisplay, w, mMozProfileAtom,
|
|
- 0, (65536 / sizeof(long)),
|
|
- False, XA_STRING,
|
|
- &type, &format, &nitems, &bytesafter,
|
|
- &data_return);
|
|
+ Unused << XGetWindowProperty(mDisplay, w, mMozProfileAtom,
|
|
+ 0, (65536 / sizeof(long)),
|
|
+ False, XA_STRING,
|
|
+ &type, &format, &nitems, &bytesafter,
|
|
+ &data_return);
|
|
|
|
// If there's a profile compare it with what we have
|
|
if (data_return) {
|
|
|