X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aacd4b50d35ae61a89dfbe83d5c84fa3c66386b6..ff58644a54af11b74b8e9b33a00de8496c531566:/src/gtk/toplevel.cpp diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index f79d8234e5..94b65ad038 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -324,6 +324,9 @@ gtk_frame_realized_callback( GtkWidget * WXUNUSED(widget), win->SetIcon( wxNullIcon ); win->SetIcons( iconsOld ); } + + if (win->HasFlag(wxFRAME_SHAPED)) + win->SetShape(win->m_shape); // it will really set the window shape now } } @@ -1164,13 +1167,22 @@ bool wxTopLevelWindowGTK::SetShape(const wxRegion& region) wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false, _T("Shaped windows must be created with the wxFRAME_SHAPED style.")); - GdkWindow *window = NULL; - if (m_wxwindow) + if ( GTK_WIDGET_REALIZED(m_widget) ) + { + if ( m_wxwindow ) + do_shape_combine_region(m_wxwindow->window, region); + + return do_shape_combine_region(m_widget->window, region); + } + else // not realized yet { - do_shape_combine_region(m_wxwindow->window, region); + // store the shape to set, it will be really set once we're realized + m_shape = region; + + // we don't know if we're going to succeed or fail, be optimistic by + // default + return true; } - window = m_widget->window; - return do_shape_combine_region(window, region); } bool wxTopLevelWindowGTK::IsActive()