-
-// helper
-static bool do_shape_combine_region(GdkWindow* window, const wxRegion& region)
-{
- if (window)
- {
- if (region.IsEmpty())
- {
- gdk_window_shape_combine_mask(window, NULL, 0, 0);
- }
- else
- {
- gdk_window_shape_combine_region(window, region.GetRegion(), 0, 0);
- return true;
- }
- }
- return false;
-}
-
-
-bool wxTopLevelWindowGTK::SetShape(const wxRegion& region)
-{
- wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
- _T("Shaped windows must be created with the wxFRAME_SHAPED style."));
-
- 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
- {
- // 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;
- }
-}
-