[Libreoffice-commits] core.git: vcl/inc vcl/unx
Caolán McNamara
caolanm at redhat.com
Sun May 8 15:29:37 UTC 2016
vcl/inc/unx/gtk/gtkframe.hxx | 2 +-
vcl/unx/gtk3/gtk3gtkframe.cxx | 19 ++++++++++---------
2 files changed, 11 insertions(+), 10 deletions(-)
New commits:
commit 7c775c157693b076b014104b3548d202e0267895
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun May 8 16:27:23 2016 +0100
Resolves: tdf#96604 remove and restore full stack of grabs
Change-Id: I51b5943f52ccdce6b4b50131f5f2b7d2c1ff7368
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 45ea636..6cc42a4 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -300,7 +300,7 @@ class GtkSalFrame : public SalFrame
static GdkNativeWindow findTopLevelSystemWindow( GdkNativeWindow aWindow );
static int m_nFloats;
- static GtkWidget* m_pGrabWidgetBeforeShowFloats;
+ static std::vector<GtkWidget*> m_aGrabWidgetsBeforeShowFloat;
bool isFloatGrabWindow() const
{
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index d716a5c..ec96b07 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -104,7 +104,7 @@
using namespace com::sun::star;
int GtkSalFrame::m_nFloats = 0;
-GtkWidget* GtkSalFrame::m_pGrabWidgetBeforeShowFloats = nullptr;
+std::vector<GtkWidget*> GtkSalFrame::m_aGrabWidgetsBeforeShowFloat;
#if defined ENABLE_GMENU_INTEGRATION
static GDBusConnection* pSessionBus = nullptr;
@@ -1418,9 +1418,12 @@ void GtkSalFrame::Show( bool bVisible, bool bNoActivate )
m_nFloats++;
if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 1 )
{
- m_pGrabWidgetBeforeShowFloats = gtk_grab_get_current();
- if (m_pGrabWidgetBeforeShowFloats)
- gtk_grab_remove(m_pGrabWidgetBeforeShowFloats);
+ GtkWidget* pGrabWidgetBeforeShowFloat;
+ while ((pGrabWidgetBeforeShowFloat = gtk_grab_get_current()))
+ {
+ m_aGrabWidgetsBeforeShowFloat.push_back(pGrabWidgetBeforeShowFloat);
+ gtk_grab_remove(pGrabWidgetBeforeShowFloat);
+ }
grabPointer(true, true);
GtkSalFrame *pKeyboardFrame = m_pParent ? m_pParent : this;
pKeyboardFrame->grabKeyboard(true);
@@ -1442,11 +1445,9 @@ void GtkSalFrame::Show( bool bVisible, bool bNoActivate )
GtkSalFrame *pKeyboardFrame = m_pParent ? m_pParent : this;
pKeyboardFrame->grabKeyboard(false);
grabPointer(false);
- if (m_pGrabWidgetBeforeShowFloats)
- {
- gtk_grab_add(m_pGrabWidgetBeforeShowFloats);
- m_pGrabWidgetBeforeShowFloats = nullptr;
- }
+ for (auto i = m_aGrabWidgetsBeforeShowFloat.rbegin(); i != m_aGrabWidgetsBeforeShowFloat.rend(); ++i)
+ gtk_grab_add(*i);
+ m_aGrabWidgetsBeforeShowFloat.clear();
}
}
gtk_widget_hide( m_pWindow );
More information about the Libreoffice-commits
mailing list