From 3a8b3bd1597952135585d7e4e852a4933611f1f7 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 18 Oct 2006 19:02:29 +0000 Subject: [PATCH] Support wxFULLSCREEN_NOMENUBAR git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42096 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/frame.cpp | 21 +++++++++++++++------ src/gtk/toplevel.cpp | 8 ++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 801f14ac60..bc3afd8551 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -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 diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 3f8b6b74ed..95e31b363a 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -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 -- 2.45.2