Bug 1194397 - Force gdk_window_ensure_native on gdk window creation. r=acomminos, a=ritu
authorLee Salzman <lsalzman@mozilla.com>
Tue, 25 Aug 2015 18:42:40 -0400
changeset 288923 e0f3c1fde8c84af06aa2f158959cb721e7092856
parent 288922 b46868d2fe6237dbf18f6e94126c170f074bfb94
child 288924 c6dd528dba68d2dc8a6289d28ee03a78f58211f7
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersacomminos, ritu
bugs1194397
milestone42.0a2
Bug 1194397 - Force gdk_window_ensure_native on gdk window creation. r=acomminos, a=ritu
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3705,16 +3705,24 @@ nsWindow::Create(nsIWidget        *aPare
         LOG(("\tmGdkWindow %p parent %p\n",
              mGdkWindow, gdk_window_get_parent(mGdkWindow)));
     }
 
     // resize so that everything is set to the right dimensions
     if (!mIsTopLevel)
         Resize(mBounds.x, mBounds.y, mBounds.width, mBounds.height, false);
 
+#ifdef MOZ_X11
+    if (mGdkWindow) {
+      // force creation of native window via internal call to gdk_window_ensure_native
+      // in case it was not created already
+      gdk_x11_window_get_xid(mGdkWindow);
+    }
+#endif
+
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindow::SetWindowClass(const nsAString &xulWinType)
 {
   if (!mShell)
     return NS_ERROR_FAILURE;