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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 9 12:25:34 UTC 2021


 vcl/unx/gtk3/gtk3gtksalmenu.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 2b042a343d25294360972492e36cb84e448eb211
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Feb 8 13:49:53 2021 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Feb 9 13:24:55 2021 +0100

    tdf#140225 call cancel before destroying menubar
    
    a) in case there are some menus open cancel them before removing
    their parent menubar
    b) when a GtkSalMenu is deleted clear the action-group of the
    hierarchy and flag it as needed a refresh, clearing it of
    any references to the deleted GtkSalMenu
    
    Change-Id: I9ec59c52c72b8b58976a8ee41727ca7612ebf6b1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110542
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtksalmenu.cxx b/vcl/unx/gtk3/gtk3gtksalmenu.cxx
index f78bbab0081f..c5e0a9518e39 100644
--- a/vcl/unx/gtk3/gtk3gtksalmenu.cxx
+++ b/vcl/unx/gtk3/gtk3gtksalmenu.cxx
@@ -596,6 +596,16 @@ GtkSalMenu::~GtkSalMenu()
 {
     SolarMutexGuard aGuard;
 
+    if (mpActionGroup)
+    {
+        // tdf#140225 if any menu is deleted clear the action-group shared
+        // by the hierarchy
+        GLOActionGroup* pActionGroup = G_LO_ACTION_GROUP(mpActionGroup);
+        g_lo_action_group_clear(pActionGroup);
+        // and flag the hierarchy as needing an update
+        SetNeedsUpdate();
+    }
+
     DestroyMenuBarWidget();
 
     if (mpMenuModel)
@@ -998,6 +1008,10 @@ void GtkSalMenu::DestroyMenuBarWidget()
 {
     if (mpMenuBarContainerWidget)
     {
+        // tdf#140225 call cancel before destroying it in case there are some
+        // active menus popped open
+        gtk_menu_shell_cancel(GTK_MENU_SHELL(mpMenuBarWidget));
+
         gtk_widget_destroy(mpMenuBarContainerWidget);
         mpMenuBarContainerWidget = nullptr;
         mpCloseButton = nullptr;


More information about the Libreoffice-commits mailing list