[Libreoffice-commits] core.git: vcl/inc vcl/unx

Caolán McNamara caolanm at redhat.com
Mon Jun 27 10:17:01 UTC 2016


 vcl/inc/unx/gtk/gtkframe.hxx  |    2 ++
 vcl/unx/gtk/gtksalmenu.cxx    |    2 +-
 vcl/unx/gtk3/gtk3gtkframe.cxx |    9 +++++++--
 3 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit f7c888994db744396c69aa1be720c2089ada5798
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 27 11:12:20 2016 +0100

    Resolves: rhbz#1342823 toolbar menus popdown immediately
    
    Change-Id: I9cecf50fb85d84e108ccc23d22bf97d2ac510a9b

diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 30c0743..610692e 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -536,6 +536,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 c9974ef..75c19c3 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 c6e1d5f..47e41dc 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2013,6 +2013,11 @@ void GtkSalFrame::SetAlwaysOnTop( bool bOnTop )
 
 static guint32 nLastUserInputTime = GDK_CURRENT_TIME;
 
+guint32 GtkSalFrame::GetLastInputEventTime()
+{
+    return nLastUserInputTime;
+}
+
 static void UpdateLastInputEventTime(guint32 nUserInputTime)
 {
     nLastUserInputTime = nUserInputTime;
@@ -2027,9 +2032,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
         {


More information about the Libreoffice-commits mailing list