Added fix for mozbz#1234026 - crashes on XWayland

This commit is contained in:
Martin Stransky 2016-01-07 12:56:07 +01:00
parent b39173f330
commit 9638b52090
2 changed files with 64 additions and 1 deletions

View File

@ -77,7 +77,7 @@
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 43.0.3
Release: 3%{?pre_tag}%{?dist}
Release: 4%{?pre_tag}%{?dist}
URL: http://www.mozilla.org/projects/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Group: Applications/Internet
@ -116,6 +116,7 @@ Patch221: firefox-fedora-ua.patch
Patch222: firefox-gtk3-20.patch
# Upstream patches
Patch300: mozilla-1234026.patch
# Gtk3 upstream patches
@ -262,6 +263,8 @@ cd %{tarballdir}
%patch222 -p1 -b .gtk3-20
%endif
%patch300 -p1 -b .1234026
%patch500 -p1
%patch501 -p1
@ -756,6 +759,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#---------------------------------------------------------------------
%changelog
* Thu Jan 7 2016 Martin Stransky <stransky@redhat.com> - 43.0.3-4
- Added fix for mozbz#1234026 - crashes on XWayland
* Tue Jan 05 2016 Marcin Juszkiewicz <mjuszkiewicz@redhat.com> - 43.0.3-3
- Fix build on AArch64.

57
mozilla-1234026.patch Normal file
View File

@ -0,0 +1,57 @@
From 01c739425470990efd607fdf57c9b24033c71300 Mon Sep 17 00:00:00 2001
From: Mike Hommey <mh+mozilla@glandium.org>
Date: Wed, 23 Dec 2015 12:11:45 +0900
Subject: [PATCH] Bug 1234026 - Pass a --display option to gtk_init in content
processes
---
dom/ipc/ContentChild.cpp | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp
index 14a7302..cfec4b7 100644
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -615,17 +615,38 @@ NS_INTERFACE_MAP_BEGIN(ContentChild)
NS_INTERFACE_MAP_END
bool
ContentChild::Init(MessageLoop* aIOLoop,
base::ProcessId aParentPid,
IPC::Channel* aChannel)
{
#ifdef MOZ_WIDGET_GTK
- gtk_init(nullptr, nullptr);
+ // We need to pass a display down to gtk_init because it's not going to
+ // use the one from the environment on its own when deciding which backend
+ // to use, and when starting under XWayland, it may choose to start with
+ // the wayland backend instead of the x11 backend.
+ // We could use gdk_display_open, and gdk_display_manager_set_default_display
+ // but then we'd have to hold onto it and gdk_display_close it at the
+ // right moment, so it's simpler to just pass down a fake argv list.
+ // The DISPLAY environment variable is normally set by the parent process.
+ const char *display_name = PR_GetEnv("DISPLAY");
+ if (display_name) {
+ int argc = 3;
+ const char *argv[] = {
+ nullptr,
+ "--display",
+ display_name,
+ nullptr
+ };
+ char** argv_ = const_cast<char**>(argv);
+ gtk_init(&argc, &argv_);
+ } else {
+ gtk_init(nullptr, nullptr);
+ }
#endif
#ifdef MOZ_WIDGET_QT
// sigh, seriously
nsQAppInstance::AddRef();
#endif
#ifdef MOZ_X11
--
2.6.1