1
0
MozillaFirefox/mozilla-bmo1744896.patch
Wolfgang Rosenauer b18fda39cd Accepting request 943030 from home:iznogood:branches:mozilla:Factory
- Add upstream patches:
  * mozilla-bmo1745560.patch: Fix build against wayland 1.20.
  * mozilla-bmo1744896.patch: Create WaylandVsyncSource on window
    creation

OBS-URL: https://build.opensuse.org/request/show/943030
OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=949
2021-12-29 09:38:41 +00:00

44 lines
1.6 KiB
Diff

diff -up firefox-95.0.2/widget/gtk/nsWindow.cpp.1744896 firefox-95.0.2/widget/gtk/nsWindow.cpp
--- firefox-95.0.2/widget/gtk/nsWindow.cpp.1744896 2021-12-23 11:54:31.522539340 +0100
+++ firefox-95.0.2/widget/gtk/nsWindow.cpp 2021-12-23 11:55:56.070270174 +0100
@@ -5765,6 +5765,17 @@ nsresult nsWindow::Create(nsIWidget* aPa
}
}
#endif
+#ifdef MOZ_WAYLAND
+ // Initialize the window specific VsyncSource early in order to avoid races
+ // with BrowserParent::UpdateVsyncParentVsyncSource().
+ // Only use for toplevel windows for now, see bug 1619246.
+ if (GdkIsWaylandDisplay() &&
+ StaticPrefs::widget_wayland_vsync_enabled_AtStartup() &&
+ mWindowType == eWindowType_toplevel) {
+ mWaylandVsyncSource = new WaylandVsyncSource();
+ MOZ_RELEASE_ASSERT(mWaylandVsyncSource);
+ }
+#endif
// We create input contexts for all containers, except for
// toplevel popup windows
@@ -6077,19 +6088,12 @@ void nsWindow::ResumeCompositorFromCompo
void nsWindow::WaylandStartVsync() {
#ifdef MOZ_WAYLAND
- // only use for toplevel windows for now - see bug 1619246
- if (!GdkIsWaylandDisplay() ||
- !StaticPrefs::widget_wayland_vsync_enabled_AtStartup() ||
- mWindowType != eWindowType_toplevel) {
+ if (!mWaylandVsyncSource) {
return;
}
LOG("nsWindow::WaylandStartVsync() [%p]\n", (void*)this);
- if (!mWaylandVsyncSource) {
- mWaylandVsyncSource = new WaylandVsyncSource();
- }
-
WaylandVsyncSource::WaylandDisplay& display =
static_cast<WaylandVsyncSource::WaylandDisplay&>(
mWaylandVsyncSource->GetGlobalDisplay());