diff options
author | Joe Shaw <joe@ximian.com> | 2002-02-13 22:49:40 +0000 |
---|---|---|
committer | Joe Shaw <joeshaw@src.gnome.org> | 2002-02-13 22:49:40 +0000 |
commit | 3a4a6edb79fc111a343f2caa7892787c74416e6a (patch) | |
tree | 93f6de13dd7bd130c308019ff6faf12fc12061fd /gtk/gtktreeitem.c | |
parent | d000d2bb6de4b50a8ead060eef9dd91a265a1240 (diff) | |
download | gtk+-3a4a6edb79fc111a343f2caa7892787c74416e6a.tar.gz |
Don't chain up to the container's expose event. Instead call
2002-02-13 Joe Shaw <joe@ximian.com>
* gtk/gtktreeitem.c (gtk_tree_item_expose): Don't chain up to the
container's expose event. Instead call
gtk_tree_item_expose_child() on each child. Avoids a failed
g_assert() in gtk_container_propagate_expose().
(gtk_tree_item_expose_child): Added. Synthesize an expose event
for our children. Basically gtk_container_propagate_expose()
minus the g_assert(). (#71396)
Diffstat (limited to 'gtk/gtktreeitem.c')
-rw-r--r-- | gtk/gtktreeitem.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/gtk/gtktreeitem.c b/gtk/gtktreeitem.c index ba1fe88a07..f3a8cb673c 100644 --- a/gtk/gtktreeitem.c +++ b/gtk/gtktreeitem.c @@ -689,10 +689,42 @@ gtk_tree_item_button_press (GtkWidget *widget, return (event->type == GDK_BUTTON_PRESS && GTK_WIDGET_IS_SENSITIVE(widget)); } +static void +gtk_tree_item_expose_child (GtkWidget *child, + gpointer client_data) +{ + struct { + GtkWidget *container; + GdkEventExpose *event; + } *data = client_data; + GdkEventExpose child_event; + + if (GTK_WIDGET_DRAWABLE (child) && + GTK_WIDGET_NO_WINDOW (child) && + (child->window == data->event->window)) + { + child_event = *data->event; + + child_event.region = gtk_widget_region_intersect (child, + data->event->region); + if (!gdk_region_empty (child_event.region)) + { + gdk_region_get_clipbox (child_event.region, &child_event.area); + gtk_widget_send_expose (child, (GdkEvent *) &child_event); + } + gdk_region_destroy (child_event.region); + } +} + static gint gtk_tree_item_expose (GtkWidget *widget, GdkEventExpose *event) { + struct { + GtkWidget *container; + GdkEventExpose *event; + } data; + g_return_val_if_fail (GTK_IS_TREE_ITEM (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); @@ -700,7 +732,12 @@ gtk_tree_item_expose (GtkWidget *widget, { gtk_tree_item_paint (widget, &event->area); - (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event); + data.container = widget; + data.event = event; + + gtk_container_forall (GTK_CONTAINER (widget), + gtk_tree_item_expose_child, + &data); } return FALSE; |