X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f819b4a3ab6cd6432e00e936fecc9b34393f38b1..a111f2b216a90bacb254644d3cae526eddc9f9f1:/src/gtk1/toplevel.cpp diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index 422f586a9d..5a90fb519d 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -50,10 +50,6 @@ extern int g_openDialogs; // event tables // ---------------------------------------------------------------------------- -#ifndef __WXUNIVERSAL__ - IMPLEMENT_DYNAMIC_CLASS(wxTopLevelWindow, wxWindow) -#endif - // ---------------------------------------------------------------------------- // data // ---------------------------------------------------------------------------- @@ -190,9 +186,9 @@ gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget), wxTopLevelWindowGTK * /* All this is for Motif Window Manager "hints" and is supposed to be recognized by other WM as well. Not tested. */ - gdk_window_set_decorations(win->m_widget->window, + gdk_window_set_decorations(win->m_widget->window, (GdkWMDecoration)win->m_gdkDecor); - gdk_window_set_functions(win->m_widget->window, + gdk_window_set_functions(win->m_widget->window, (GdkWMFunction)win->m_gdkFunc); /* GTK's shrinking/growing policy */ @@ -377,14 +373,17 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, if (style & wxFRAME_TOOL_WINDOW) win_type = GTK_WINDOW_POPUP; - + if (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) win_type = GTK_WINDOW_DIALOG; m_widget = gtk_window_new( win_type ); - if ((m_parent) && (HasFlag(wxFRAME_FLOAT_ON_PARENT)) && (GTK_IS_WINDOW(m_parent->m_widget))) + if (m_parent && (GTK_IS_WINDOW(m_parent->m_widget)) && + (HasFlag(wxFRAME_FLOAT_ON_PARENT) || (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG))) + { gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) ); + } if (!name.IsEmpty()) gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() ); @@ -474,9 +473,9 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, { m_gdkDecor = (long) GDK_DECOR_BORDER; m_gdkFunc = (long) GDK_FUNC_MOVE; - + // All this is for Motif Window Manager "hints" and is supposed to be - // recognized by other WM as well. Not tested. + // recognized by other WM as well. Not tested. if ((style & wxCAPTION) != 0) m_gdkDecor |= GDK_DECOR_TITLE; if ((style & wxSYSTEM_MENU) != 0) @@ -528,7 +527,8 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style ) if (show) { - m_fsSaveStyle = m_windowStyle; + m_fsSaveGdkFunc = m_gdkFunc; + m_fsSaveGdkDecor = m_gdkDecor; m_fsSaveFlag = style; GetPosition( &m_fsSaveFrame.x, &m_fsSaveFrame.y ); GetSize( &m_fsSaveFrame.width, &m_fsSaveFrame.height ); @@ -536,7 +536,8 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style ) gtk_widget_hide( m_widget ); gtk_widget_unrealize( m_widget ); - m_windowStyle = wxSIMPLE_BORDER; + m_gdkDecor = (long) GDK_DECOR_BORDER; + m_gdkFunc = (long) GDK_FUNC_MOVE; int x; int y; @@ -551,7 +552,8 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style ) gtk_widget_hide( m_widget ); gtk_widget_unrealize( m_widget ); - m_windowStyle = m_fsSaveStyle; + m_gdkFunc = m_fsSaveGdkFunc; + m_gdkDecor = m_fsSaveGdkDecor; SetSize( m_fsSaveFrame.x, m_fsSaveFrame.y, m_fsSaveFrame.width, m_fsSaveFrame.height ); @@ -679,12 +681,12 @@ void wxTopLevelWindowGTK::DoSetClientSize( int width, int height ) { wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); - DoSetSize(-1, -1, + DoSetSize(-1, -1, width + m_miniEdge*2, height + m_miniEdge*2 + m_miniTitle, 0); } void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), - int width, int height ) + int width, int height ) { // due to a bug in gtk, x,y are always 0 // m_x = x;