Bug 1401634 - Flush window XID to X server before we pass the XID to gpu process, r=jhorak
authorMartin Stransky <stransky@redhat.com>
Fri, 27 Jul 2018 14:00:09 +0200
changeset 486895 bb68176153170621f14b6125145607dd797b7375
parent 486894 c3b99983344fa998358d59ef8d8087dbc28f7481
child 486896 c7ac54e3457f898f08c27705f98c9dc985e457ce
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhorak
bugs1401634
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1401634 - Flush window XID to X server before we pass the XID to gpu process, r=jhorak Make sure the window XID is propagated to X server, we can fail otherwise in GPU process. MozReview-Commit-ID: BMkLvhs4vRt
widget/gtk/GtkCompositorWidget.cpp
widget/gtk/nsWindow.cpp
--- a/widget/gtk/GtkCompositorWidget.cpp
+++ b/widget/gtk/GtkCompositorWidget.cpp
@@ -35,17 +35,19 @@ GtkCompositorWidget::GtkCompositorWidget
     mProvider.Initialize(aWindow);
   } else
 #endif
   {
     mXWindow = (Window)aInitData.XWindow();
 
     // Grab the window's visual and depth
     XWindowAttributes windowAttrs;
-    XGetWindowAttributes(mXDisplay, mXWindow, &windowAttrs);
+    if (!XGetWindowAttributes(mXDisplay, mXWindow, &windowAttrs)) {
+      NS_WARNING("GtkCompositorWidget(): XGetWindowAttributes() failed!");
+    }
 
     Visual*   visual = windowAttrs.visual;
     int       depth = windowAttrs.depth;
 
     // Initialize the window surface provider
     mProvider.Initialize(
       mXDisplay,
       mXWindow,
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -7195,16 +7195,22 @@ nsWindow::GetSystemCSDSupportLevel() {
 int32_t
 nsWindow::RoundsWidgetCoordinatesTo()
 {
     return GdkScaleFactor();
 }
 
 void nsWindow::GetCompositorWidgetInitData(mozilla::widget::CompositorWidgetInitData* aInitData)
 {
+  // Make sure the window XID is propagated to X server, we can fail otherwise
+  // in GPU process (Bug 1401634).
+  if (mXDisplay && mXWindow != X11None) {
+    XFlush(mXDisplay);
+  }
+
   *aInitData = mozilla::widget::GtkCompositorWidgetInitData(
                                 (mXWindow != X11None) ? mXWindow : (uintptr_t)nullptr,
                                 mXDisplay ? nsCString(XDisplayString(mXDisplay)) : nsCString(),
                                 mIsTransparent && !mHasAlphaVisual,
                                 GetClientSize());
 }
 
 #ifdef MOZ_WAYLAND