X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6089c4c8e8f9a6b177c57fae83bd0ffe48045177..169dc97542bcf418ad8244bdba45014e2337d9a6:/src/gtk/toplevel.cpp?ds=inline diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 5d04f3bcb3..f6c6327d12 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -416,13 +416,12 @@ static gboolean property_notify_event( static GdkAtom property = gdk_atom_intern("_NET_FRAME_EXTENTS", false); if (event->state == GDK_PROPERTY_NEW_VALUE && event->atom == property) { + wxSize decorSize = win->m_decorSize; int left, right, top, bottom; if (wxGetFrameExtents(event->window, &left, &right, &top, &bottom)) - { - const wxSize decorSize = - wxSize(left + right, top + bottom); - win->GTKUpdateDecorSize(decorSize); - } + decorSize.Set(left + right, top + bottom); + + win->GTKUpdateDecorSize(decorSize); } return false; } @@ -662,7 +661,7 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK() if (m_grabbed) { - wxFAIL_MSG(_T("Window still grabbed")); + wxFAIL_MSG(wxT("Window still grabbed")); RemoveGrab(); } @@ -777,34 +776,51 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long) // overridden wxWindow methods // ---------------------------------------------------------------------------- +void wxTopLevelWindowGTK::Refresh( bool WXUNUSED(eraseBackground), const wxRect *WXUNUSED(rect) ) +{ + wxCHECK_RET( m_widget, wxT("invalid frame") ); + + gtk_widget_queue_draw( m_widget ); + + if (m_wxwindow && m_wxwindow->window) + gdk_window_invalidate_rect( m_wxwindow->window, NULL, TRUE ); +} + bool wxTopLevelWindowGTK::Show( bool show ) { wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); - bool deferShow = show && !m_isShown && m_deferShow && m_deferShowAllowed; + bool deferShow = show && !m_isShown && m_deferShow; if (deferShow) { - deferShow = false; - if (!GTK_WIDGET_REALIZED(m_widget) && - g_signal_handler_find(m_widget, + deferShow = m_deferShowAllowed && !GTK_WIDGET_REALIZED(m_widget); + if (deferShow) + { + deferShow = g_signal_handler_find(m_widget, GSignalMatchType(G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DATA), g_signal_lookup("property_notify_event", GTK_TYPE_WIDGET), - 0, NULL, NULL, this)) + 0, NULL, NULL, this) != 0; + } + GdkScreen* screen = NULL; + if (deferShow) { - if (gdk_x11_screen_supports_net_wm_hint( - gtk_widget_get_screen(m_widget), - gdk_atom_intern("_NET_REQUEST_FRAME_EXTENTS", false))) - { - deferShow = true; - } - else - { - // Don't allow changes to m_decorSize, it breaks saving/restoring - // window size with GetSize()/SetSize() because it makes window - // bigger between each restore and save. - m_updateDecorSize = false; - } + screen = gtk_widget_get_screen(m_widget); + GdkAtom atom = gdk_atom_intern("_NET_REQUEST_FRAME_EXTENTS", false); + deferShow = gdk_x11_screen_supports_net_wm_hint(screen, atom) != 0; + // If _NET_REQUEST_FRAME_EXTENTS not supported, don't allow changes + // to m_decorSize, it breaks saving/restoring window size with + // GetSize()/SetSize() because it makes window bigger between each + // restore and save. + m_updateDecorSize = deferShow; + } + if (deferShow) + { + // Fluxbox support for _NET_REQUEST_FRAME_EXTENTS is broken + const char* name = gdk_x11_screen_get_window_manager_name(screen); + deferShow = strcmp(name, "Fluxbox") != 0; + m_updateDecorSize = deferShow; } + m_deferShow = deferShow; } if (deferShow) @@ -1220,7 +1236,7 @@ static bool do_shape_combine_region(GdkWindow* window, const wxRegion& region) bool wxTopLevelWindowGTK::SetShape(const wxRegion& region) { wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false, - _T("Shaped windows must be created with the wxFRAME_SHAPED style.")); + wxT("Shaped windows must be created with the wxFRAME_SHAPED style.")); if ( GTK_WIDGET_REALIZED(m_widget) ) {