Blob Blame History Raw
From 722d918c8f185daae2f3c01cc77d1b3badec936a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 16 Nov 2016 11:52:39 +0000
Subject: [PATCH] gtk: under wayland tracking the window position is worthless

which isn't news, but...

with focus follows mouse enabled, activate filter menu of a calc autofilter.
Move the mouse around and enter the menu, menu pops down because there are
configure and mouse events which indicate that the position of the main
application window has "moved"

when LibreOffice detects the window has moved, it closes the windows
popups, so the menu disappears.

Change-Id: I2d1aa4a51153002c925e2dde4402da2d84e52de5
---
 vcl/source/app/settings.cxx               |  2 +-
 vcl/unx/gtk3/gtk3gtkframe.cxx             | 10 ++++++++--
 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx |  2 +-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 9ef9fd2..d6f6300 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -1935,7 +1935,7 @@ bool
 StyleSettings::GetDockingFloatsSupported()
 {
     ImplSVData* pSVData = ImplGetSVData();
-    return pSVData->maNWFData.mbDockingFloatsSupported;
+    return pSVData->maNWFData.mbCanDetermineWindowPosition;
 }
 
 void
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 77735391..24ffcdd 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2772,7 +2772,9 @@ gboolean GtkSalFrame::signalMotion( GtkWidget*, GdkEventMotion* pEvent, gpointer
     {
         pThis->maGeometry.nX = frame_x;
         pThis->maGeometry.nY = frame_y;
-        pThis->CallCallbackExc(SalEvent::Move, nullptr);
+        ImplSVData* pSVData = ImplGetSVData();
+        if (pSVData->maNWFData.mbCanDetermineWindowPosition)
+            pThis->CallCallbackExc(SalEvent::Move, nullptr);
     }
 
     if( ! aDel.isDeleted() )
@@ -2894,7 +2896,11 @@ gboolean GtkSalFrame::signalConfigure(GtkWidget*, GdkEventConfigure* pEvent, gpo
     pThis->updateScreenNumber();
 
     if (bMoved)
-        pThis->CallCallbackExc(SalEvent::Move, nullptr);
+    {
+        ImplSVData* pSVData = ImplGetSVData();
+        if (pSVData->maNWFData.mbCanDetermineWindowPosition)
+            pThis->CallCallbackExc(SalEvent::Move, nullptr);
+    }
 
     return false;
 }
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 091a615..55ebc71 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -2330,7 +2330,7 @@ void GtkData::initNWF()
     //and floating dockable toolbars
     GdkDisplay *pDisplay = gdk_display_get_default();
     if (GDK_IS_WAYLAND_DISPLAY(pDisplay))
-        pSVData->maNWFData.mbDockingFloatsSupported = false;
+        pSVData->maNWFData.mbCanDetermineWindowPosition = false;
 #endif
 }
 
-- 
2.9.3