]> git.saurik.com Git - wxWidgets.git/commitdiff
Support wxFULLSCREEN_NOMENUBAR
authorRobert Roebling <robert@roebling.de>
Wed, 18 Oct 2006 19:02:29 +0000 (19:02 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 18 Oct 2006 19:02:29 +0000 (19:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42096 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/frame.cpp
src/gtk/toplevel.cpp

index 801f14ac60b20c94ef778bb9b3373d9a89732a30..bc3afd85512f126a9154c91d7163b88f7874ea3a 100644 (file)
@@ -362,16 +362,17 @@ void wxFrame::GtkOnSize()
                                        (GtkWidget*) NULL,
                                        &geom,
                                        (GdkWindowHints) flag );
+        // TODO
+        // Rewrite this terrible code to using GtkVBox
 
-        // I revert back to wxGTK's original behaviour. m_mainWidget holds
-        // the menubar, the toolbar and the client area, which is represented
-        // by m_wxwindow.
-        // This hurts in the eye, but I don't want to call SetSize()
-        // because I don't want to call any non-native functions here.
+        // m_mainWidget holds the menubar, the toolbar and the client
+        // area, which is represented by m_wxwindow.
 
 #if wxUSE_MENUS_NATIVE
-        if (m_frameMenuBar)
+        if (m_frameMenuBar && !(m_fsIsShowing && (m_fsSaveFlag & wxFULLSCREEN_NOMENUBAR != 0)))
         {
+            if (!GTK_WIDGET_VISIBLE(m_frameMenuBar->m_widget))
+                gtk_widget_show( m_frameMenuBar->m_widget );
             int xx = m_miniEdge;
             int yy = m_miniEdge + m_miniTitle;
             int ww = m_width  - 2*m_miniEdge;
@@ -388,6 +389,14 @@ void wxFrame::GtkOnSize()
                                   xx, yy, ww, hh );
             client_area_y_offset += hh;
         }
+        else
+        {
+            if (m_frameMenuBar)
+            {
+                if (GTK_WIDGET_VISIBLE(m_frameMenuBar->m_widget))
+                    gtk_widget_hide( m_frameMenuBar->m_widget );
+            }
+        }
 #endif // wxUSE_MENUS_NATIVE
 
 #if wxUSE_TOOLBAR
index 3f8b6b74edaaa58034f3f2183fb62f60b66c9091..95e31b363a377db22fbe3a94f3384e92ff6d709c 100644 (file)
@@ -443,6 +443,7 @@ void wxTopLevelWindowGTK::Init()
     m_insertInClientArea = true;
     m_isIconized = false;
     m_fsIsShowing = false;
+    m_fsSaveFlag = 0;
     m_themeEnabled = true;
     m_gdkDecor = m_gdkFunc = 0;
     m_grabbed = false;
@@ -714,9 +715,15 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
     if ( (method == wxX11_FS_WMSPEC) && !gtk_check_version(2,2,0) )
     {
         if (show)
+        {
+            m_fsSaveFlag = style;
             gtk_window_fullscreen( GTK_WINDOW( m_widget ) );
+        }
         else
+        {
+            m_fsSaveFlag = 0;
             gtk_window_unfullscreen( GTK_WINDOW( m_widget ) );
+        }
     }
     else
 #endif // GTK+ >= 2.2.0
@@ -759,6 +766,7 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
         }
         else // hide
         {
+            m_fsSaveFlag = 0;
             if (method != wxX11_FS_WMSPEC)
             {
                 // don't do it always, Metacity hates it