summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-03-03 15:55:40 +0100
committerMaxim Monastirsky <momonasmon@gmail.com>2017-03-06 09:34:03 +0000
commitf2fa5951bf3d02439a3e96d1f9d89962f0901edc (patch)
tree5b31682eff1ac03f48475ec5bcc811052cfc7143
parentb3afee4b61740b20bb7430bd6bbe25023f705f3a (diff)
tdf#106271 Cannot disable Menubar under Unity
Empty the global menu when the user wants to hide the menubar. When showing it again, the global menu is refilled. Change-Id: I3c5e17100622cd8d22c4348cf90a76233dd0fd4c Reviewed-on: https://gerrit.libreoffice.org/34869 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Jenkins <ci@libreoffice.org> Tested-by: Maxim Monastirsky <momonasmon@gmail.com> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
-rw-r--r--vcl/unx/gtk/gtksalmenu.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 90b29e7bd8df..1c23cde891a5 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -1162,7 +1162,15 @@ void GtkSalMenu::EnableUnity(bool bEnable)
void GtkSalMenu::ShowMenuBar( bool bVisible )
{
- if (bVisible && !bUnityMode && !mpMenuBarContainerWidget)
+ // Unity tdf#106271: Can't hide global menu, so empty it instead when user wants to hide menubar,
+ if (bUnityMode)
+ {
+ if (bVisible)
+ Update();
+ else if (mpMenuModel && g_menu_model_get_n_items(G_MENU_MODEL(mpMenuModel)) > 0)
+ g_lo_menu_remove(G_LO_MENU(mpMenuModel), 0);
+ }
+ else if (bVisible && !mpMenuBarContainerWidget)
CreateMenuBarWidget();
else
DestroyMenuBarWidget();