[Libreoffice-commits] core.git: vcl/unx
Samuel Mehrbrodt
Samuel.Mehrbrodt at cib.de
Mon Mar 6 09:34:34 UTC 2017
vcl/unx/gtk/gtksalmenu.cxx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit f2fa5951bf3d02439a3e96d1f9d89962f0901edc
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date: Fri Mar 3 15:55:40 2017 +0100
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 at CIB.de>
Tested-by: Jenkins <ci at libreoffice.org>
Tested-by: Maxim Monastirsky <momonasmon at gmail.com>
Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 90b29e7..1c23cde 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();
More information about the Libreoffice-commits
mailing list