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 d7348960f8da0999dfdec1c17f3d66f330f696b1
parent 521665 7f3111601872c9d6e2a49a52cc57f7c7a25210e7
child 521667 3a2f408c40dfae660f297434a152b4b01d3c508c
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;