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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 19 21:08:14 UTC 2018


 vcl/unx/gtk/gtksalmenu.cxx |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 3bedbfd9b3cee5a8d2da6ee0486859bd725979ba
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Dec 19 16:23:06 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Dec 19 22:08:00 2018 +0100

    Resolves: tdf#121555 sometime crash on menu hierarchy change
    
    seems menubar gets set to dirty due to some menu activity that needs
    a refresh, but then the hierarchy changes and as its already dirty
    the maUpdateMenuBarIdle doesn't get launched
    
    the placement of the mbMenuBar test inside the loop through parents
    shows some confusion as to what which mbMenuBar might be met, the
    one belonging to this, or that of the parent being traversed, but
    it does seem to be the one belonging to this.
    
    Change-Id: I0b9dceadf64f7adf18eb1aa2dbda9bbfbcb66e0a
    Reviewed-on: https://gerrit.libreoffice.org/65452
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index f6f45cf4acad..8329c376eda7 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -226,8 +226,12 @@ void GtkSalMenu::ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries)
     if (mbNeedsUpdate)
     {
         mbNeedsUpdate = false;
-        if (mbMenuBar)
+        if (mbMenuBar && maUpdateMenuBarIdle.IsActive())
+        {
             maUpdateMenuBarIdle.Stop();
+            maUpdateMenuBarIdle.Invoke();
+            return;
+        }
     }
 
     Menu* pVCLMenu = mpVCLMenu;
@@ -556,13 +560,17 @@ IMPL_LINK_NOARG(GtkSalMenu, MenuBarHierarchyChangeHandler, Timer *, void)
 void GtkSalMenu::SetNeedsUpdate()
 {
     GtkSalMenu* pMenu = this;
+    // start that the menu and its parents are in need of an update
+    // on the next activation
     while (pMenu && !pMenu->mbNeedsUpdate)
     {
         pMenu->mbNeedsUpdate = true;
-        if (mbMenuBar)
-            maUpdateMenuBarIdle.Start();
         pMenu = pMenu->mpParentSalMenu;
     }
+    // only if a menubar is directly updated do we force in a full
+    // structure update
+    if (mbMenuBar && !maUpdateMenuBarIdle.IsActive())
+        maUpdateMenuBarIdle.Start();
 }
 
 void GtkSalMenu::SetMenuModel(GMenuModel* pMenuModel)


More information about the Libreoffice-commits mailing list