Kaydet (Commit) 3bedbfd9 authored tarafından Caolán McNamara's avatar Caolán McNamara

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: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 2dc3a6c2
...@@ -226,8 +226,12 @@ void GtkSalMenu::ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries) ...@@ -226,8 +226,12 @@ void GtkSalMenu::ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries)
if (mbNeedsUpdate) if (mbNeedsUpdate)
{ {
mbNeedsUpdate = false; mbNeedsUpdate = false;
if (mbMenuBar) if (mbMenuBar && maUpdateMenuBarIdle.IsActive())
{
maUpdateMenuBarIdle.Stop(); maUpdateMenuBarIdle.Stop();
maUpdateMenuBarIdle.Invoke();
return;
}
} }
Menu* pVCLMenu = mpVCLMenu; Menu* pVCLMenu = mpVCLMenu;
...@@ -556,13 +560,17 @@ IMPL_LINK_NOARG(GtkSalMenu, MenuBarHierarchyChangeHandler, Timer *, void) ...@@ -556,13 +560,17 @@ IMPL_LINK_NOARG(GtkSalMenu, MenuBarHierarchyChangeHandler, Timer *, void)
void GtkSalMenu::SetNeedsUpdate() void GtkSalMenu::SetNeedsUpdate()
{ {
GtkSalMenu* pMenu = this; GtkSalMenu* pMenu = this;
// start that the menu and its parents are in need of an update
// on the next activation
while (pMenu && !pMenu->mbNeedsUpdate) while (pMenu && !pMenu->mbNeedsUpdate)
{ {
pMenu->mbNeedsUpdate = true; pMenu->mbNeedsUpdate = true;
if (mbMenuBar)
maUpdateMenuBarIdle.Start();
pMenu = pMenu->mpParentSalMenu; 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) void GtkSalMenu::SetMenuModel(GMenuModel* pMenuModel)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment