Fix crashes on f36 multimonitor setup and too big profile manager

This commit is contained in:
Jan Horak 2022-05-10 17:17:03 +02:00
parent db2e77cf9f
commit c66f451d52
3 changed files with 59 additions and 1 deletions

View File

@ -163,7 +163,7 @@ ExcludeArch: aarch64
Summary: Mozilla Firefox Web browser Summary: Mozilla Firefox Web browser
Name: firefox Name: firefox
Version: 100.0 Version: 100.0
Release: 4%{?pre_tag}%{?dist} Release: 5%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/ URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+ License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz
@ -218,6 +218,7 @@ Patch61: firefox-glibc-dynstack.patch
Patch62: build-python.patch Patch62: build-python.patch
Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch
Patch72: D142373.diff Patch72: D142373.diff
Patch73: mozilla-1767916-multimonitor-crash.patch
# Test patches # Test patches
# Generate without context by # Generate without context by
@ -243,6 +244,7 @@ Patch408: mozilla-1663844.patch
Patch415: mozilla-1670333.patch Patch415: mozilla-1670333.patch
Patch416: D145094.diff Patch416: D145094.diff
Patch417: D145541.diff Patch417: D145541.diff
Patch418: mozilla-1767946-profilemanagersize.patch
# PGO/LTO patches # PGO/LTO patches
Patch600: pgo.patch Patch600: pgo.patch
@ -461,6 +463,7 @@ This package contains results of tests executed during build.
%patch54 -p1 -b .1669639 %patch54 -p1 -b .1669639
%patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12
%patch72 -p1 -b .D142373 %patch72 -p1 -b .D142373
%patch73 -p1 -b .mozilla-1767916-multimonitor-crash
# Test patches # Test patches
#%patch100 -p1 -b .firefox-tests-xpcshell #%patch100 -p1 -b .firefox-tests-xpcshell
@ -484,6 +487,7 @@ This package contains results of tests executed during build.
%patch415 -p1 -b .1670333 %patch415 -p1 -b .1670333
%patch416 -p1 -b .D145094 %patch416 -p1 -b .D145094
%patch417 -p1 -b .D145541 %patch417 -p1 -b .D145541
%patch418 -p1 -b .mozilla-1767946-profilemanagersize
# PGO patches # PGO patches
%if %{build_with_pgo} %if %{build_with_pgo}
@ -1050,6 +1054,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#--------------------------------------------------------------------- #---------------------------------------------------------------------
%changelog %changelog
* Tue May 10 2022 Jan Horak <jhorak@redhat.com> - 100.0-5
- Fix crashes on f36 multimonitor setup and too big profile manager
* Mon May 9 2022 Martin Stransky <stransky@redhat.com>- 100.0-4 * Mon May 9 2022 Martin Stransky <stransky@redhat.com>- 100.0-4
- Added fix for mozbz#1767916. - Added fix for mozbz#1767916.

View File

@ -0,0 +1,21 @@
diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp
--- a/widget/gtk/MozContainerWayland.cpp
+++ b/widget/gtk/MozContainerWayland.cpp
@@ -527,10 +527,16 @@
return;
}
LOGWAYLAND("%s [%p] scale %d\n", __FUNCTION__,
(void*)moz_container_get_nsWindow(container), scale);
+ // There is a chance that the attached wl_buffer has not yet been doubled
+ // on the main thread when scale factor changed to 2. This leads to
+ // crash with the following message:
+ // Buffer size (AxB) must be an integer multiple of the buffer_scale (2)
+ // Removing the possibly wrong wl_buffer to prevent that crash:
+ wl_surface_attach(wl_container->surface, nullptr, 0, 0);
wl_surface_set_buffer_scale(wl_container->surface, scale);
wl_container->buffer_scale = scale;
}
}

View File

@ -0,0 +1,30 @@
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3787,11 +3787,12 @@
mPendingConfigures--;
}
// Don't fire configure event for scale changes, we handle that
// OnScaleChanged event. Skip that for toplevel windows only.
- if (mWindowType == eWindowType_toplevel) {
+ if (mWindowType == eWindowType_toplevel ||
+ mWindowType == eWindowType_dialog) {
MOZ_DIAGNOSTIC_ASSERT(mGdkWindow,
"Getting configure for invisible window?");
if (mWindowScaleFactor != gdk_window_get_scale_factor(mGdkWindow)) {
LOG(" scale factor changed to %d,return early",
gdk_window_get_scale_factor(mGdkWindow));
@@ -4864,10 +4865,11 @@
// Force scale factor recalculation
if (!mGdkWindow) {
mWindowScaleFactorChanged = true;
return;
}
+ LOG("OnScaleChanged -> %d\n", gdk_window_get_scale_factor(mGdkWindow));
// Gtk supply us sometimes with doubled events so stay calm in such case.
if (gdk_window_get_scale_factor(mGdkWindow) == mWindowScaleFactor) {
return;
}