Bug 1464826 - [Wayland] Don't calculate popup offset relatively to mShell on Wayland as it's relative to mContainer, r=jhorak
authorMartin Stransky <stransky@redhat.com>
Thu, 30 Aug 2018 09:15:15 +0000
changeset 491815 e0c2014dde1bdcab48c0e3308be93eb0640e9c93
parent 491814 d85d49538117bc902dae505c9ff6de555b9b89f9
child 491816 4a462d6e9c46f9ace4debb9ca80aa503e983baca
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
bugs1464826
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 1464826 - [Wayland] Don't calculate popup offset relatively to mShell on Wayland as it's relative to mContainer, r=jhorak Differential Revision: https://phabricator.services.mozilla.com/D4073
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -6721,16 +6721,23 @@ nsWindow::ClearCachedResources()
  * paint code to update mClientOffset any time. It also propagates
  * the mClientOffset to child tabs.
  *
  * It works only for CSD decorated GtkWindow.
  */
 void
 nsWindow::UpdateClientOffsetForCSDWindow()
 {
+    // We update window offset on X11 as the window position is calculated
+    // relatively to mShell. We don't do that on Wayland as our wl_subsurface
+    // is attached to mContainer and mShell is ignored.
+    if (!mIsX11Display) {
+        return;
+    }
+
     // _NET_FRAME_EXTENTS is not set on client decorated windows,
     // so we need to read offset between mContainer and toplevel mShell
     // window.
     if (mSizeState == nsSizeMode_Normal) {
         GtkBorder decorationSize;
         GetCSDDecorationSize(GTK_WINDOW(mShell), &decorationSize);
         mClientOffset = nsIntPoint(decorationSize.left, decorationSize.top);
     } else {