summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
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)