Fixed crashes on multi-monitor systems
This commit is contained in:
		
							parent
							
								
									1f98173a5b
								
							
						
					
					
						commit
						949ba97268
					
				
							
								
								
									
										65
									
								
								D158747.diff
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								D158747.diff
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,65 @@ | |||||||
|  | diff --git a/widget/gtk/ScreenHelperGTK.cpp b/widget/gtk/ScreenHelperGTK.cpp
 | ||||||
|  | --- a/widget/gtk/ScreenHelperGTK.cpp
 | ||||||
|  | +++ b/widget/gtk/ScreenHelperGTK.cpp
 | ||||||
|  | @@ -221,11 +221,11 @@
 | ||||||
|  |                                 refreshRate, contentsScale, defaultCssScale, dpi, | ||||||
|  |                                 Screen::IsPseudoDisplay::No); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  void ScreenGetterGtk::RefreshScreens() { | ||||||
|  | -  LOG_SCREEN("Refreshing screens");
 | ||||||
|  | +  LOG_SCREEN("ScreenGetterGtk::RefreshScreens()");
 | ||||||
|  |    AutoTArray<RefPtr<Screen>, 4> screenList; | ||||||
|  |   | ||||||
|  |    GdkScreen* defaultScreen = gdk_screen_get_default(); | ||||||
|  |    gint numScreens = gdk_screen_get_n_monitors(defaultScreen); | ||||||
|  |    LOG_SCREEN("GDK reports %d screens", numScreens); | ||||||
|  | @@ -387,16 +387,16 @@
 | ||||||
|  |                                 monitor->refresh, contentsScale, defaultCssScale, | ||||||
|  |                                 dpi, Screen::IsPseudoDisplay::No); | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  void ScreenGetterWayland::RefreshScreens() { | ||||||
|  | -  LOG_SCREEN("Refreshing screens");
 | ||||||
|  | +  LOG_SCREEN("ScreenGetterWayland::RefreshScreens()");
 | ||||||
|  |    AutoTArray<RefPtr<Screen>, 4> managerScreenList; | ||||||
|  |   | ||||||
|  |    mScreenList.Clear(); | ||||||
|  |    const gint numScreens = mMonitors.Length(); | ||||||
|  | -  LOG_SCREEN("Wayland reports %d screens", numScreens);
 | ||||||
|  | +  LOG_SCREEN("Wayland reports %d monitors", numScreens);
 | ||||||
|  |    for (gint i = 0; i < numScreens; i++) { | ||||||
|  |      RefPtr<Screen> screen = MakeScreenWayland(i); | ||||||
|  |      mScreenList.AppendElement(screen); | ||||||
|  |      managerScreenList.AppendElement(screen); | ||||||
|  |    } | ||||||
|  | @@ -446,18 +446,27 @@
 | ||||||
|  |   | ||||||
|  |    return -1; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  RefPtr<nsIScreen> ScreenGetterWayland::GetScreenForWindow(nsWindow* aWindow) { | ||||||
|  | -  if (mScreenList.IsEmpty()) {
 | ||||||
|  | +  if (mMonitors.IsEmpty()) {
 | ||||||
|  |      return nullptr; | ||||||
|  |    } | ||||||
|  |   | ||||||
|  |    int monitor = GetMonitorForWindow(aWindow); | ||||||
|  |    if (monitor < 0) { | ||||||
|  |      return nullptr; | ||||||
|  |    } | ||||||
|  | +
 | ||||||
|  | +  if (mMonitors.Length() != mScreenList.Length()) {
 | ||||||
|  | +    // Gtk list of GtkScreens are out of sync with our monitor list.
 | ||||||
|  | +    // Try to refresh it now.
 | ||||||
|  | +    RefreshScreens();
 | ||||||
|  | +  }
 | ||||||
|  | +
 | ||||||
|  | +  MOZ_DIAGNOSTIC_ASSERT((unsigned)monitor < mScreenList.Length(),
 | ||||||
|  | +                        "We're missing screen?");
 | ||||||
|  |    return mScreenList[monitor]; | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  static bool IsGNOMECompositor() { | ||||||
|  |    const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP"); | ||||||
|  | 
 | ||||||
| @ -163,7 +163,7 @@ ExcludeArch: i686 | |||||||
| Summary:        Mozilla Firefox Web browser | Summary:        Mozilla Firefox Web browser | ||||||
| Name:           firefox | Name:           firefox | ||||||
| Version:        105.0.2 | Version:        105.0.2 | ||||||
| Release:        1%{?pre_tag}%{?dist} | Release:        2%{?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 | ||||||
| @ -243,6 +243,7 @@ Patch407:        mozilla-1667096.patch | |||||||
| Patch408:        mozilla-1663844.patch | Patch408:        mozilla-1663844.patch | ||||||
| Patch415:        mozilla-1670333.patch | Patch415:        mozilla-1670333.patch | ||||||
| Patch416:        mozilla-1791856.patch | Patch416:        mozilla-1791856.patch | ||||||
|  | Patch417:        D158747.diff | ||||||
| 
 | 
 | ||||||
| # PGO/LTO patches | # PGO/LTO patches | ||||||
| Patch600:        pgo.patch | Patch600:        pgo.patch | ||||||
| @ -501,6 +502,7 @@ This package contains results of tests executed during build. | |||||||
| %patch408 -p1 -b .1663844 | %patch408 -p1 -b .1663844 | ||||||
| %patch415 -p1 -b .1670333 | %patch415 -p1 -b .1670333 | ||||||
| %patch416 -p1 -b .1791856 | %patch416 -p1 -b .1791856 | ||||||
|  | %patch417 -p1 -b .D158747 | ||||||
| 
 | 
 | ||||||
| # PGO patches | # PGO patches | ||||||
| %if %{build_with_pgo} | %if %{build_with_pgo} | ||||||
| @ -1090,6 +1092,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : | |||||||
| #--------------------------------------------------------------------- | #--------------------------------------------------------------------- | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Fri Oct 14 2022 Martin Stransky <stransky@redhat.com>- 105.0.2-2 | ||||||
|  | - Fixed crashes on multi-monitor systems (mzbz#1793922) | ||||||
|  | 
 | ||||||
| * Wed Oct 5 2022 Martin Stransky <stransky@redhat.com>- 105.0.2-1 | * Wed Oct 5 2022 Martin Stransky <stransky@redhat.com>- 105.0.2-1 | ||||||
| - Updated to 105.0.2 | - Updated to 105.0.2 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user