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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 25 19:12:14 UTC 2021


 vcl/unx/gtk3/gtkinst.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 7be06a4dce699d8216b5978155ab3e575dda0367
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jun 25 13:00:55 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jun 25 21:11:33 2021 +0200

    gtk3: gtk_menu_attach_to_widget to the final pWidget
    
    probably doesn't make a difference in practice
    
    Change-Id: I3a015a1585aa2a7d100acd8e6edbfa30d4549ffe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117883
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index e0c3047875ff..cb036803d5eb 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -10404,13 +10404,12 @@ public:
 #else
         gulong nSignalId = g_signal_connect_swapped(G_OBJECT(m_pMenu), "deactivate", G_CALLBACK(g_main_loop_quit), pLoop);
 
-        gtk_menu_attach_to_widget(m_pMenu, pWidget, nullptr);
-
 #if GTK_CHECK_VERSION(3,22,0)
         if (gtk_check_version(3, 22, 0) == nullptr)
         {
             GdkRectangle aRect;
             pWidget = getPopupRect(pWidget, rRect, aRect);
+            gtk_menu_attach_to_widget(m_pMenu, pWidget, nullptr);
 
             // Send a keyboard event through gtk_main_do_event to toggle any active tooltip offs
             // before trying to launch the menu
@@ -10432,6 +10431,8 @@ public:
         (void) rRect;
 #endif
         {
+            gtk_menu_attach_to_widget(m_pMenu, pWidget, nullptr);
+
             guint nButton;
             guint32 nTime;
 
@@ -10441,7 +10442,8 @@ public:
             GdkEvent *pEvent = gtk_get_current_event();
             if (pEvent)
             {
-                gdk_event_get_button(pEvent, &nButton);
+                if (!gdk_event_get_button(pEvent, &nButton))
+                    nButton = 0;
                 nTime = gdk_event_get_time(pEvent);
             }
             else


More information about the Libreoffice-commits mailing list