vcl/inc/unx/gtk/gtkframe.hxx   |    4 +++-
 vcl/inc/unx/gtk/gtksalmenu.hxx |    2 ++
 vcl/unx/gtk/gtksalframe.cxx    |    7 ++-----
 vcl/unx/gtk3/gtk3gtkframe.cxx  |   13 ++++++++-----
 4 files changed, 15 insertions(+), 11 deletions(-)

New commits:
commit 33b194c2b8eb51facc452f5f7e2b4cef7ee34339
Author: Caolán McNamara <caol...@redhat.com>
Date:   Fri Nov 10 13:48:54 2017 +0000

    Related: tdf#112549 gtk3 hide/show menubar on enter/exit fullscreen
    
    Change-Id: I0436d0f3404a88abd81c4eedea09b16c81536b61
    Reviewed-on: https://gerrit.libreoffice.org/44599
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit 97d09553425b59d030fd4d8f039a4a9994b674cf)
    Reviewed-on: https://gerrit.libreoffice.org/44809
    Reviewed-by: Yousuf Philips <philip...@hotmail.com>

diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 1f28dd0804bf..cf644b281c77 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -68,6 +68,8 @@ class GtkDnDTransferable;
     typedef void GDBusConnection;
 #endif
 
+class GtkSalMenu;
+
 class GtkSalFrame : public SalFrame
                   , public NativeWindowHandleProvider
 {
@@ -221,7 +223,7 @@ class GtkSalFrame : public SalFrame
     bool                            m_bSetFocusOnMap;
 #endif
 
-    SalMenu*                        m_pSalMenu;
+    GtkSalMenu*                     m_pSalMenu;
 
 #if ENABLE_DBUS && ENABLE_GIO
     private:
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 9a5ef3ed67ab..c4d3b7246660 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -121,6 +121,8 @@ public:
     GtkSalMenu*                 GetTopLevel();
     void                        SetNeedsUpdate();
 
+    GtkWidget*                  GetMenuBarContainerWidget() const { return 
mpMenuBarContainerWidget; }
+
     void CreateMenuBarWidget();
     void DestroyMenuBarWidget();
     gboolean SignalKey(GdkEventKey* pEvent);
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 5a06b220adad..f352af4fdf19 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -21,6 +21,7 @@
 #include <unx/gtk/gtkdata.hxx>
 #include <unx/gtk/gtkinst.hxx>
 #include <unx/gtk/gtkgdi.hxx>
+#include <unx/gtk/gtksalmenu.hxx>
 #include <vcl/help.hxx>
 #include <vcl/keycodes.hxx>
 #include <vcl/layout.hxx>
@@ -1422,11 +1423,7 @@ void GtkSalFrame::SetIcon( sal_uInt16 nIcon )
 
 void GtkSalFrame::SetMenu( SalMenu* pSalMenu )
 {
-//    if(m_pSalMenu)
-//    {
-//        static_cast<GtkSalMenu*>(m_pSalMenu)->DisconnectFrame();
-//    }
-    m_pSalMenu = pSalMenu;
+    m_pSalMenu = static_cast<GtkSalMenu*>(pSalMenu);
 }
 
 SalMenu* GtkSalFrame::GetMenu()
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index cff6e2d0b577..c69aa3f71b13 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1398,11 +1398,7 @@ void GtkSalFrame::SetIcon( sal_uInt16 nIcon )
 
 void GtkSalFrame::SetMenu( SalMenu* pSalMenu )
 {
-//    if(m_pSalMenu)
-//    {
-//        static_cast<GtkSalMenu*>(m_pSalMenu)->DisconnectFrame();
-//    }
-    m_pSalMenu = pSalMenu;
+    m_pSalMenu = static_cast<GtkSalMenu*>(pSalMenu);
 }
 
 SalMenu* GtkSalFrame::GetMenu()
@@ -1929,8 +1925,11 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, 
SetType eType, tools::Rect
     gdk_window_set_fullscreen_mode( widget_get_window(m_pWindow), 
m_bSpanMonitorsWhenFullscreen
         ? GDK_FULLSCREEN_ON_ALL_MONITORS : GDK_FULLSCREEN_ON_CURRENT_MONITOR );
 #endif
+    GtkWidget* pMenuBarContainerWidget = m_pSalMenu ? 
m_pSalMenu->GetMenuBarContainerWidget() : nullptr;
     if( eType == SetType::Fullscreen )
     {
+        if (pMenuBarContainerWidget)
+            gtk_widget_hide(pMenuBarContainerWidget);
         if (m_bSpanMonitorsWhenFullscreen)
             gtk_window_fullscreen(GTK_WINDOW(m_pWindow));
         else
@@ -1944,7 +1943,11 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, 
SetType eType, tools::Rect
 
     }
     else if( eType == SetType::UnFullscreen )
+    {
+        if (pMenuBarContainerWidget)
+            gtk_widget_show(pMenuBarContainerWidget);
         gtk_window_unfullscreen( GTK_WINDOW( m_pWindow ) );
+    }
 
     if( eType == SetType::UnFullscreen &&
         !(m_nStyle & SalFrameStyleFlags::SIZEABLE) )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to