[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara
caolanm at redhat.com
Thu Jun 9 16:40:40 UTC 2016
vcl/unx/gtk3/gtk3gtkframe.cxx | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
New commits:
commit ffbd9647698738084c7a69fc72a2a7317109df7c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jun 9 17:40:13 2016 +0100
wrong hunk included
Change-Id: I5fbeea83393e811cdf333f3cf456cbd6cc2f9d6c
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index c76e2cd..5a12fa6 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1440,11 +1440,15 @@ void GtkSalFrame::Show( bool bVisible, bool bNoActivate )
m_nFloats++;
if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 1 )
{
- GdkDeviceManager* pDeviceManager = gdk_display_get_device_manager(getGdkDisplay());
- GdkDevice* pPointer = gdk_device_manager_get_client_pointer(pDeviceManager);
- GdkDevice* pKeyboard = gdk_device_get_associated_device(pPointer);
- gtk_device_grab_add(m_pParent->getWindow(), pPointer, false);
- gtk_device_grab_add(m_pParent->getWindow(), pKeyboard, false);
+ 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);
}
// #i44068# reset parent's IM context
if( m_pParent )
@@ -1460,11 +1464,12 @@ void GtkSalFrame::Show( bool bVisible, bool bNoActivate )
m_nFloats--;
if( ! getDisplay()->GetCaptureFrame() && m_nFloats == 0)
{
- GdkDeviceManager* pDeviceManager = gdk_display_get_device_manager(getGdkDisplay());
- GdkDevice* pPointer = gdk_device_manager_get_client_pointer(pDeviceManager);
- GdkDevice* pKeyboard = gdk_device_get_associated_device(pPointer);
- gtk_device_grab_remove(m_pParent->getWindow(), pKeyboard);
- gtk_device_grab_remove(m_pParent->getWindow(), pPointer);
+ GtkSalFrame *pKeyboardFrame = m_pParent ? m_pParent : this;
+ pKeyboardFrame->grabKeyboard(false);
+ grabPointer(false);
+ 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