summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-12-19 16:23:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-12-20 12:10:29 +0100
commitc72ddb5e185d33e17762bc96207b86948950e173 (patch)
tree03fc07d5f1b6de5d8183faacdc9d9f90cdc0c6f4 /vcl
parent9396cf7edb101983c56f44ae814029ce78f0fc71 (diff)
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/65465 Tested-by: Jenkins Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk/gtksalmenu.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 8fd2ea29636a..c946ae0d32d4 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;
@@ -520,13 +524,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)