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

Maxim Monastirsky momonasmon at gmail.com
Sun Feb 28 08:36:25 UTC 2016


 vcl/inc/unx/gtk/gtksalmenu.hxx |    1 -
 vcl/unx/gtk/gtksalmenu.cxx     |   13 +++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 48217c28706d22306d17ab7d73b702389d7545a4
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Sun Feb 28 10:29:26 2016 +0200

    Fix gtk2 menubar
    
    Change-Id: I0605e570022f6eb57d453a3eb8bea5f4314c8229

diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index e01c934..d828a7c 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -80,7 +80,11 @@ static gchar* GetCommandForItem( GtkSalMenuItem* pSalMenuItem, gchar* aCurrentCo
 
 bool GtkSalMenu::PrepUpdate()
 {
+#if GTK_CHECK_VERSION(3,0,0)
     return mpMenuModel && mpActionGroup;
+#else
+    return bUnityMode && mpMenuModel && mpActionGroup;
+#endif
 }
 
 /*
@@ -461,7 +465,11 @@ GtkSalMenu::~GtkSalMenu()
 
 bool GtkSalMenu::VisibleMenuBar()
 {
+#if GTK_CHECK_VERSION(3,0,0)
     return mbMenuBar;
+#else
+    return mbMenuBar && bUnityMode;
+#endif
 }
 
 void GtkSalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos )
commit 1e53d134f03831f4e0f6d3646c20283c4a01b897
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Sun Feb 28 10:27:28 2016 +0200

    mbUnityMode is always false
    
    Change-Id: I7c4b05cd02dee2b6efb926955759d725428e1dc1

diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index b88aec8..51cb451 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -44,7 +44,6 @@ private:
     std::vector< GtkSalMenuItem* >  maItems;
 
     bool                            mbMenuBar;
-    bool                            mbUnityMode;
     GtkWidget*                      mpMenuBarWidget;
     GtkWidget*                      mpCloseButton;
     Menu*                           mpVCLMenu;
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index b89a351..e01c934 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -428,7 +428,6 @@ bool GtkSalMenu::ShowNativePopupMenu(FloatingWindow* pWin, const Rectangle& /*rR
 
 GtkSalMenu::GtkSalMenu( bool bMenuBar ) :
     mbMenuBar( bMenuBar ),
-    mbUnityMode ( false ),
     mpMenuBarWidget( nullptr ),
     mpCloseButton( nullptr ),
     mpVCLMenu( nullptr ),
@@ -654,13 +653,11 @@ void GtkSalMenu::SetFrame(const SalFrame* pFrame)
     g_lo_menu_insert_section( pMenuModel, 0, nullptr, mpMenuModel );
 
 #if GTK_CHECK_VERSION(3,0,0)
-    if (!mbUnityMode)
+    if (!bUnityMode)
     {
         DestroyMenuBarWidget();
         CreateMenuBarWidget();
     }
-#else
-    (void)mbUnityMode;
 #endif
 }
 


More information about the Libreoffice-commits mailing list