[Libreoffice-commits] core.git: 3 commits - vcl/unx

Maxim Monastirsky momonasmon at gmail.com
Thu Mar 16 19:55:11 UTC 2017


 vcl/unx/gtk/gtksalframe.cxx   |    1 -
 vcl/unx/gtk/gtksalmenu.cxx    |   13 ++++++++-----
 vcl/unx/gtk3/gtk3gtkframe.cxx |    1 -
 3 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 5bb0cc118396c27a880ecab76c3ab383d6c8c0ff
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Fri Mar 10 02:42:56 2017 +0200

    Keep menubar hidden after Unity registrar activated
    
    ... if it was hidden before. Otherwise it becomes
    out of sync with MenuBar::mbDisplayable.
    
    Change-Id: I03c551ee70131a50fa694b7009c24833ac391990

diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index c03764ff3158..371f9be54f16 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -726,7 +726,6 @@ void on_registrar_available( GDBusConnection * /*connection*/,
     {
         GtkSalMenu* pGtkSalMenu = static_cast<GtkSalMenu*>(pSalMenu);
         pGtkSalMenu->EnableUnity(true);
-        pGtkSalMenu->UpdateFull();
     }
 }
 
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index fe7eecedecdb..3540f6eab714 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -1157,14 +1157,19 @@ void GtkSalMenu::EnableUnity(bool bEnable)
     bUnityMode = bEnable;
 
     MenuBar* pMenuBar(static_cast<MenuBar*>(mpVCLMenu.get()));
+    bool bDisplayable(pMenuBar->IsDisplayable());
 
     if (bEnable)
+    {
         DestroyMenuBarWidget();
+        UpdateFull();
+        if (!bDisplayable)
+            ShowMenuBar(false);
+    }
     else
     {
         Update();
-        if (pMenuBar->IsDisplayable())
-            CreateMenuBarWidget();
+        ShowMenuBar(bDisplayable);
     }
 
     pMenuBar->LayoutChanged();
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 9ecef8367aa0..543574f1e962 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -742,7 +742,6 @@ void on_registrar_available( GDBusConnection * /*connection*/,
     {
         GtkSalMenu* pGtkSalMenu = static_cast<GtkSalMenu*>(pSalMenu);
         pGtkSalMenu->EnableUnity(true);
-        pGtkSalMenu->UpdateFull();
     }
 }
 
commit 7c3f18ca3be629c2113e168ffe442c4e89cfeaea
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Fri Mar 10 01:20:45 2017 +0200

    This conditional isn't needed
    
    Change-Id: If54f3d815605b07fae505b52e3b532af608e9b7e

diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index ec253945c89e..fe7eecedecdb 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -846,13 +846,11 @@ void GtkSalMenu::SetFrame(const SalFrame* pFrame)
 
     g_lo_menu_insert_section( pMenuModel, 0, nullptr, mpMenuModel );
 
-#if GTK_CHECK_VERSION(3,0,0)
     if (!bUnityMode && static_cast<MenuBar*>(mpVCLMenu.get())->IsDisplayable())
     {
         DestroyMenuBarWidget();
         CreateMenuBarWidget();
     }
-#endif
 }
 
 const GtkSalFrame* GtkSalMenu::GetFrame() const
commit 0e31d0aa855f7f5ab4875bae916d277fc3c96998
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Fri Mar 10 01:12:08 2017 +0200

    gtk3: Keep menubar hidden after customization
    
    ... if it was hidden before. Otherwise it becomes
    out of sync with MenuBar::mbDisplayable.
    
    Change-Id: I4957f5cef916abfa54add2901b330463364d3dba

diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index e4d2ebab2c31..ec253945c89e 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -847,7 +847,7 @@ void GtkSalMenu::SetFrame(const SalFrame* pFrame)
     g_lo_menu_insert_section( pMenuModel, 0, nullptr, mpMenuModel );
 
 #if GTK_CHECK_VERSION(3,0,0)
-    if (!bUnityMode)
+    if (!bUnityMode && static_cast<MenuBar*>(mpVCLMenu.get())->IsDisplayable())
     {
         DestroyMenuBarWidget();
         CreateMenuBarWidget();


More information about the Libreoffice-commits mailing list