Skip to content

Commit

Permalink
Bug 1874857 [Wayland] Don't use Wayland proxy if --display param is p…
Browse files Browse the repository at this point in the history
…rovided r=emilio

Depends on D199699

Differential Revision: https://phabricator.services.mozilla.com/D199700
  • Loading branch information
stransky committed Jan 27, 2024
1 parent 41bcaaf commit 94bf009
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions toolkit/xre/nsAppRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4698,25 +4698,27 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
const char* display_name = nullptr;
bool saveDisplayArg = false;

// display_name is owned by gdk.
display_name = gdk_get_display_arg_name();
bool waylandEnabled = IsWaylandEnabled();
# ifdef MOZ_WAYLAND
auto* proxyEnv = getenv("MOZ_DISABLE_WAYLAND_PROXY");
bool disableWaylandProxy = proxyEnv && *proxyEnv;
if (!disableWaylandProxy && XRE_IsParentProcess() && waylandEnabled) {
if (!display_name) {
auto* proxyEnv = getenv("MOZ_DISABLE_WAYLAND_PROXY");
bool disableWaylandProxy = proxyEnv && *proxyEnv;
if (!disableWaylandProxy && XRE_IsParentProcess() && waylandEnabled) {
# ifdef MOZ_LOGGING
if (MOZ_LOG_TEST(gWidgetWaylandLog, mozilla::LogLevel::Debug)) {
WaylandProxy::SetVerbose(true);
}
if (MOZ_LOG_TEST(gWidgetWaylandLog, mozilla::LogLevel::Debug)) {
WaylandProxy::SetVerbose(true);
}
# endif
gWaylandProxy = WaylandProxy::Create();
if (gWaylandProxy) {
gWaylandProxy->RunThread();
gWaylandProxy = WaylandProxy::Create();
if (gWaylandProxy) {
gWaylandProxy->RunThread();
}
}
}
# endif

// display_name is owned by gdk.
display_name = gdk_get_display_arg_name();
// if --display argument is given make sure it's
// also passed to ContentChild::Init() by MOZ_GDK_DISPLAY.
if (display_name) {
Expand Down

0 comments on commit 94bf009

Please sign in to comment.