Bug 1431399 - [Wayland] Render eWindowType_child as a toplevel window on Wayland, r=ashie
authorMartin Stransky <stransky@redhat.com>
Wed, 13 Mar 2019 08:24:29 +0000
changeset 521666 d7348960f8da
parent 521665 7f3111601872
child 521667 3a2f408c40df
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersashie
bugs1431399
milestone67.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 1431399 - [Wayland] Render eWindowType_child as a toplevel window on Wayland, r=ashie eWindowType_child window (a window defined by GdkWindow only) is not supported on Wayland as we need moz_container to provide wl_surface to draw into. As a workaroud create a regular toplevel window instead of child on Wayland to enable rendering and window manipulation. Differential Revision: https://phabricator.services.mozilla.com/D23149
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3237,16 +3237,22 @@ nsresult nsWindow::Create(nsIWidget *aPa
 
   // and do our common creation
   CommonCreate(aParent, listenForResizes);
 
   // save our bounds
   mBounds = aRect;
   ConstrainSize(&mBounds.width, &mBounds.height);
 
+  // eWindowType_child is not supported on Wayland. Just switch to toplevel
+  // as a workaround.
+  if (!mIsX11Display && mWindowType == eWindowType_child) {
+    mWindowType = eWindowType_toplevel;
+  }
+
   // figure out our parent window
   GtkWidget *parentMozContainer = nullptr;
   GtkContainer *parentGtkContainer = nullptr;
   GdkWindow *parentGdkWindow = nullptr;
   GtkWindow *topLevelParent = nullptr;
   nsWindow *parentnsWindow = nullptr;
   GtkWidget *eventWidget = nullptr;
   bool drawToContainer = false;