Add gtk_widget_(un)register_window

This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
This commit is contained in:
Alexander Larsson
2013-02-05 09:36:49 +01:00
parent 4d3c77f920
commit 3d4cd4db3e
42 changed files with 183 additions and 112 deletions

View File

@ -628,7 +628,7 @@ swatch_realize (GtkWidget *widget)
swatch->priv->event_window =
gdk_window_new (window,
&attributes, attributes_mask);
gdk_window_set_user_data (swatch->priv->event_window, widget);
gtk_widget_register_window (widget, swatch->priv->event_window);
}
static void
@ -638,7 +638,7 @@ swatch_unrealize (GtkWidget *widget)
if (swatch->priv->event_window)
{
gdk_window_set_user_data (swatch->priv->event_window, NULL);
gtk_widget_unregister_window (widget, swatch->priv->event_window);
gdk_window_destroy (swatch->priv->event_window);
swatch->priv->event_window = NULL;
}