summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-06-27 11:12:20 +0100
committerEike Rathke <erack@redhat.com>2016-07-11 19:12:36 +0000
commit264a254efd60e147c4e6580f950307478f9a593f (patch)
tree52db74393a76f9d139866af88328394e439778ec /vcl
parent18b904faafb756fd28d40467153d191122f6a731 (diff)
Resolves: rhbz#1342823 toolbar menus popdown immediately
Change-Id: I9cecf50fb85d84e108ccc23d22bf97d2ac510a9b (cherry picked from commit f7c888994db744396c69aa1be720c2089ada5798) Reviewed-on: https://gerrit.libreoffice.org/26698 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx2
-rw-r--r--vcl/unx/gtk/gtksalmenu.cxx2
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx9
3 files changed, 10 insertions, 3 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 4677923e7183..2b5dc5547c3f 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -538,6 +538,8 @@ public:
static void KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode,
guint* pGdkKeyCode, GdkModifierType *pGdkModifiers);
+
+ static guint32 GetLastInputEventTime();
};
#define OOO_TYPE_FIXED ooo_fixed_get_type()
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 2e44f76d4039..873ce396d44e 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -360,7 +360,7 @@ bool GtkSalMenu::ShowNativePopupMenu(FloatingWindow* pWin, const Rectangle& rRec
else
{
nButton = 0;
- nTime = gtk_get_current_event_time();
+ nTime = GtkSalFrame::GetLastInputEventTime();
}
VclPtr<vcl::Window> xParent = pWin->ImplGetWindowImpl()->mpRealParent;
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 232035673a27..e8d12e3c3134 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2018,6 +2018,11 @@ void GtkSalFrame::SetAlwaysOnTop( bool bOnTop )
static guint32 nLastUserInputTime = GDK_CURRENT_TIME;
+guint32 GtkSalFrame::GetLastInputEventTime()
+{
+ return nLastUserInputTime;
+}
+
static void UpdateLastInputEventTime(guint32 nUserInputTime)
{
nLastUserInputTime = nUserInputTime;
@@ -2032,9 +2037,9 @@ void GtkSalFrame::ToTop( SalFrameToTop nFlags )
else if( IS_WIDGET_MAPPED( m_pWindow ) )
{
if (!(nFlags & SalFrameToTop::GrabFocusOnly))
- gtk_window_present_with_time(GTK_WINDOW(m_pWindow), nLastUserInputTime);
+ gtk_window_present_with_time(GTK_WINDOW(m_pWindow), GetLastInputEventTime());
else
- gdk_window_focus(widget_get_window(m_pWindow), nLastUserInputTime);
+ gdk_window_focus(widget_get_window(m_pWindow), GetLastInputEventTime());
}
else
{