Commit 2637485b authored by stransky's avatar stransky
Browse files

Bug 1724242 [Linux] Use DBus remote when Firefox is built with --enable-dbus, r=glandium

parent d8cb8fea
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
    SOURCES += [
        "nsGTKRemoteServer.cpp",
        "nsUnixRemoteServer.cpp",
        "nsXRemoteClient.cpp",
        "nsXRemoteServer.cpp",
        "RemoteUtils.cpp",
    ]
    if CONFIG["MOZ_ENABLE_DBUS"]:
@@ -29,6 +27,11 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
            "nsUnixRemoteServer.h",
            "RemoteUtils.h",
        ]
    else:
        SOURCES += [
            "nsXRemoteClient.cpp",
            "nsXRemoteServer.cpp",
        ]
    CXXFLAGS += CONFIG["TK_CFLAGS"]

if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
+8 −23
Original line number Diff line number Diff line
@@ -13,10 +13,11 @@
#ifdef MOZ_WIDGET_GTK
#  include "mozilla/WidgetUtilsGtk.h"
#  include "nsGTKRemoteServer.h"
#  include "nsXRemoteClient.h"
#  ifdef MOZ_ENABLE_DBUS
#    include "nsDBusRemoteServer.h"
#    include "nsDBusRemoteClient.h"
#  else
#    include "nsXRemoteClient.h"
#  endif
#elif defined(XP_WIN)
#  include "nsWinRemoteServer.h"
@@ -40,10 +41,6 @@
#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;
@@ -102,19 +99,12 @@ RemoteResult nsRemoteService::StartClient(const char* aDesktopStartupID) {
  }

  UniquePtr<nsRemoteClient> client;

#ifdef MOZ_WIDGET_GTK
  bool useX11Remote = mozilla::widget::GdkIsX11Display();

#  if defined(MOZ_ENABLE_DBUS)
  const char* dbusRemoteEnv = getenv(DBUS_REMOTE_ENV);
  if (!useX11Remote || (dbusRemoteEnv && *dbusRemoteEnv == '1')) {
  client = MakeUnique<nsDBusRemoteClient>();
  }
#  endif
  if (!client && useX11Remote) {
#  else
  client = MakeUnique<nsXRemoteClient>();
  }
#  endif
#elif defined(XP_WIN)
  client = MakeUnique<nsWinRemoteClient>();
#elif defined(XP_DARWIN)
@@ -154,16 +144,11 @@ void nsRemoteService::StartupServer() {
  }

#ifdef MOZ_WIDGET_GTK
  bool useX11Remote = mozilla::widget::GdkIsX11Display();

#  if defined(MOZ_ENABLE_DBUS)
  if (!useX11Remote || getenv(DBUS_REMOTE_ENV)) {
  mRemoteServer = MakeUnique<nsDBusRemoteServer>();
  }
#  endif
  if (!mRemoteServer && useX11Remote) {
#  else
  mRemoteServer = MakeUnique<nsGTKRemoteServer>();
  }
#  endif
#elif defined(XP_WIN)
  mRemoteServer = MakeUnique<nsWinRemoteServer>();
#elif defined(XP_DARWIN)