mozilla-bmo1744896.patch
branchfirefox95
changeset 1169 7481543bab31
equal deleted inserted replaced
1168:c384af864671 1169:7481543bab31
       
     1 diff -up firefox-95.0.2/widget/gtk/nsWindow.cpp.1744896 firefox-95.0.2/widget/gtk/nsWindow.cpp
       
     2 --- firefox-95.0.2/widget/gtk/nsWindow.cpp.1744896	2021-12-23 11:54:31.522539340 +0100
       
     3 +++ firefox-95.0.2/widget/gtk/nsWindow.cpp	2021-12-23 11:55:56.070270174 +0100
       
     4 @@ -5765,6 +5765,17 @@ nsresult nsWindow::Create(nsIWidget* aPa
       
     5        }
       
     6      }
       
     7  #endif
       
     8 +#ifdef MOZ_WAYLAND
       
     9 +  // Initialize the window specific VsyncSource early in order to avoid races
       
    10 +  // with BrowserParent::UpdateVsyncParentVsyncSource().
       
    11 +  // Only use for toplevel windows for now, see bug 1619246.
       
    12 +  if (GdkIsWaylandDisplay() &&
       
    13 +      StaticPrefs::widget_wayland_vsync_enabled_AtStartup() &&
       
    14 +      mWindowType == eWindowType_toplevel) {
       
    15 +    mWaylandVsyncSource = new WaylandVsyncSource();
       
    16 +    MOZ_RELEASE_ASSERT(mWaylandVsyncSource);
       
    17 +  }
       
    18 +#endif
       
    19  
       
    20      // We create input contexts for all containers, except for
       
    21      // toplevel popup windows
       
    22 @@ -6077,19 +6088,12 @@ void nsWindow::ResumeCompositorFromCompo
       
    23  
       
    24  void nsWindow::WaylandStartVsync() {
       
    25  #ifdef MOZ_WAYLAND
       
    26 -  // only use for toplevel windows for now - see bug 1619246
       
    27 -  if (!GdkIsWaylandDisplay() ||
       
    28 -      !StaticPrefs::widget_wayland_vsync_enabled_AtStartup() ||
       
    29 -      mWindowType != eWindowType_toplevel) {
       
    30 +  if (!mWaylandVsyncSource) {
       
    31      return;
       
    32    }
       
    33  
       
    34    LOG("nsWindow::WaylandStartVsync() [%p]\n", (void*)this);
       
    35  
       
    36 -  if (!mWaylandVsyncSource) {
       
    37 -    mWaylandVsyncSource = new WaylandVsyncSource();
       
    38 -  }
       
    39 -
       
    40    WaylandVsyncSource::WaylandDisplay& display =
       
    41        static_cast<WaylandVsyncSource::WaylandDisplay&>(
       
    42            mWaylandVsyncSource->GetGlobalDisplay());
       
    43