From c66f451d52bbb47cf83e5d3006816742beb1ecc8 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 10 May 2022 17:17:03 +0200 Subject: Fix crashes on f36 multimonitor setup and too big profile manager --- firefox.spec | 9 ++++++++- mozilla-1767916-multimonitor-crash.patch | 21 +++++++++++++++++++++ mozilla-1767946-profilemanagersize.patch | 30 ++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 mozilla-1767916-multimonitor-crash.patch create mode 100644 mozilla-1767946-profilemanagersize.patch diff --git a/firefox.spec b/firefox.spec index 13b52e2..4482ab2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 100.0 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ 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 @@ -218,6 +218,7 @@ Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch72: D142373.diff +Patch73: mozilla-1767916-multimonitor-crash.patch # Test patches # Generate without context by @@ -243,6 +244,7 @@ Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch Patch416: D145094.diff Patch417: D145541.diff +Patch418: mozilla-1767946-profilemanagersize.patch # PGO/LTO patches Patch600: pgo.patch @@ -461,6 +463,7 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch72 -p1 -b .D142373 +%patch73 -p1 -b .mozilla-1767916-multimonitor-crash # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -484,6 +487,7 @@ This package contains results of tests executed during build. %patch415 -p1 -b .1670333 %patch416 -p1 -b .D145094 %patch417 -p1 -b .D145541 +%patch418 -p1 -b .mozilla-1767946-profilemanagersize # PGO patches %if %{build_with_pgo} @@ -1050,6 +1054,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue May 10 2022 Jan Horak - 100.0-5 +- Fix crashes on f36 multimonitor setup and too big profile manager + * Mon May 9 2022 Martin Stransky - 100.0-4 - Added fix for mozbz#1767916. diff --git a/mozilla-1767916-multimonitor-crash.patch b/mozilla-1767916-multimonitor-crash.patch new file mode 100644 index 0000000..7ca3a2e --- /dev/null +++ b/mozilla-1767916-multimonitor-crash.patch @@ -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; + } + } + + diff --git a/mozilla-1767946-profilemanagersize.patch b/mozilla-1767946-profilemanagersize.patch new file mode 100644 index 0000000..4469934 --- /dev/null +++ b/mozilla-1767946-profilemanagersize.patch @@ -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; + } + -- cgit From 4fc899095270f26783e0dd350c2eb3e41c7ac978 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 11 May 2022 09:11:20 +0200 Subject: Removed already added patch: mozilla-1767916-multimonitor-crash.patch --- firefox.spec | 2 -- mozilla-1767916-multimonitor-crash.patch | 21 --------------------- 2 files changed, 23 deletions(-) delete mode 100644 mozilla-1767916-multimonitor-crash.patch diff --git a/firefox.spec b/firefox.spec index 4482ab2..336f2a5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -218,7 +218,6 @@ Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch72: D142373.diff -Patch73: mozilla-1767916-multimonitor-crash.patch # Test patches # Generate without context by @@ -463,7 +462,6 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch72 -p1 -b .D142373 -%patch73 -p1 -b .mozilla-1767916-multimonitor-crash # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell diff --git a/mozilla-1767916-multimonitor-crash.patch b/mozilla-1767916-multimonitor-crash.patch deleted file mode 100644 index 7ca3a2e..0000000 --- a/mozilla-1767916-multimonitor-crash.patch +++ /dev/null @@ -1,21 +0,0 @@ -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; - } - } - - -- cgit From 300248bcb6f3dc5126d45aeeef553547e5c22f20 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Mon, 16 May 2022 20:50:22 +0200 Subject: Fix spellchecker.dictionary_path of F36+ --- firefox-redhat-default-prefs.js | 2 +- firefox.spec | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/firefox-redhat-default-prefs.js b/firefox-redhat-default-prefs.js index 1c0be99..6fcee25 100644 --- a/firefox-redhat-default-prefs.js +++ b/firefox-redhat-default-prefs.js @@ -26,7 +26,7 @@ pref("plugins.notifyMissingFlash", false); pref("browser.display.use_system_colors", false); /* Allow sending credetials to all https:// sites */ pref("network.negotiate-auth.trusted-uris", "https://"); -pref("spellchecker.dictionary_path","/usr/share/myspell"); +pref("spellchecker.dictionary_path","/usr/share/hunspell"); /* Disable DoH by default */ pref("network.trr.mode", 5); /* Enable per-user policy dir, see mozbz#1583466 */ diff --git a/firefox.spec b/firefox.spec index 336f2a5..9b0c29c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 100.0 -Release: 5%{?pre_tag}%{?dist} +Release: 6%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ 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 @@ -905,6 +905,13 @@ ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries # Default %{__cp} %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences +# Since Fedora 36 the location of dictionaries has changed to /usr/share/hunspell. +# For backward spec compatibility we set the old path in previous versions. +# TODO remove when Fedora 35 becomes obsolete +%if 0%{?fedora} <= 35 +sed -ie 's|/usr/share/hunspell|/usr/share/myspell|g' %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js +%endif + # Copy over run-mozilla.sh %{__cp} build/unix/run-mozilla.sh %{buildroot}%{mozappdir} @@ -1052,6 +1059,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon May 16 2022 Jan Horak - 100.0-6 +- Fix spellchecker.dictionary_path of F36+ + * Tue May 10 2022 Jan Horak - 100.0-5 - Fix crashes on f36 multimonitor setup and too big profile manager -- cgit