From d2c5fe6e6e1ab3b4532b4ca0e2eeba4f9c190562 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 27 Aug 2009 05:11:01 +0000 Subject: [PATCH] avoid deferred show with Fluxbox, its support for _NET_REQUEST_FRAME_EXTENTS is broken git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/toplevel.cpp | 50 ++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index b6915adb51..4f8a7569fe 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; } @@ -794,28 +793,33 @@ bool wxTopLevelWindowGTK::Show( bool show ) bool deferShow = show && !m_isShown && m_deferShow && m_deferShowAllowed; if (deferShow) { - deferShow = false; - if (!GTK_WIDGET_REALIZED(m_widget) && - g_signal_handler_find(m_widget, + deferShow = !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)) - { - 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; - } + 0, NULL, NULL, this) != 0; } + GdkScreen* screen = NULL; + if (deferShow) + { + 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 (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_deferShow = deferShow; + // If not deferring, 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) {