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

Caolán McNamara caolanm at redhat.com
Tue Jun 7 12:19:01 UTC 2016


 vcl/unx/gtk/gtksalmenu.cxx |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

New commits:
commit c450705d51a4fe67d1e9391b2f78235b79766cfe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 7 13:16:26 2016 +0100

    gtk3: wrongly activating the parent menu and not the desired child
    
    Change-Id: I57193a424b5f19a59e98bdfe26e0cab38d4204ea

diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 70a4130..a13bb6d 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -1020,17 +1020,21 @@ void GtkSalMenu::ClearActionGroupAndMenuModel()
 void GtkSalMenu::Activate(const gchar* pCommand)
 {
     MenuAndId aMenuAndId = decode_command(pCommand);
-    GtkSalMenu* pSalSubMenu = aMenuAndId.first;
-    GtkSalMenu* pTopLevel = pSalSubMenu->GetTopLevel();
-    pTopLevel->GetMenu()->HandleMenuActivateEvent(pSalSubMenu->GetMenu());
+    GtkSalMenu* pSalMenu = aMenuAndId.first;
+    GtkSalMenu* pTopLevel = pSalMenu->GetTopLevel();
+    Menu* pVclMenu = pSalMenu->GetMenu();
+    Menu* pVclSubMenu = pVclMenu->GetPopupMenu(aMenuAndId.second);
+    pTopLevel->GetMenu()->HandleMenuActivateEvent(pVclSubMenu);
 }
 
 void GtkSalMenu::Deactivate(const gchar* pCommand)
 {
     MenuAndId aMenuAndId = decode_command(pCommand);
-    GtkSalMenu* pSalSubMenu = aMenuAndId.first;
-    GtkSalMenu* pTopLevel = pSalSubMenu->GetTopLevel();
-    pTopLevel->GetMenu()->HandleMenuDeActivateEvent(pSalSubMenu->GetMenu());
+    GtkSalMenu* pSalMenu = aMenuAndId.first;
+    GtkSalMenu* pTopLevel = pSalMenu->GetTopLevel();
+    Menu* pVclMenu = pSalMenu->GetMenu();
+    Menu* pVclSubMenu = pVclMenu->GetPopupMenu(aMenuAndId.second);
+    pTopLevel->GetMenu()->HandleMenuDeActivateEvent(pVclSubMenu);
 }
 
 void GtkSalMenu::EnableUnity(bool bEnable)


More information about the Libreoffice-commits mailing list