diff options
author | Owen Taylor <otaylor@redhat.com> | 1999-01-08 00:12:43 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 1999-01-08 00:12:43 +0000 |
commit | 41604dd844dd5ad482a9703248c290ea62a58587 (patch) | |
tree | 7ae3629ee022df43b12eba0e80ed6347d867d0d5 | |
parent | bedab705f2be0fc84b0e03e0791c8e308206bd24 (diff) | |
download | gtk+-41604dd844dd5ad482a9703248c290ea62a58587.tar.gz |
Fixes to drawing the background of the bin window so that clearing and
Thu Jan 7 19:10:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkviewport.c (gtk_viewport_style_set): Fixes
to drawing the background of the bin window
so that clearing and redrawing of child
widgets work properly.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Juggle around
data so that if somebody triggers more redraw queuing
from a expose_event handler, it doesn't confuse the
heck out of GTK+. (But is highly liable to cause
an infinite loop...)
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 13 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 13 | ||||
-rw-r--r-- | gtk/gtkviewport.c | 40 | ||||
-rw-r--r-- | gtk/gtkwidget.c | 48 |
9 files changed, 148 insertions, 31 deletions
@@ -1,3 +1,16 @@ +Thu Jan 7 19:10:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkviewport.c (gtk_viewport_style_set): Fixes + to drawing the background of the bin window + so that clearing and redrawing of child + widgets work properly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Juggle around + data so that if somebody triggers more redraw queuing + from a expose_event handler, it doesn't confuse the + heck out of GTK+. (But is highly liable to cause + an infinite loop...) + Thu Jan 7 12:31:41 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c (gtk_target_list_unref): Fix some diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 76af83356f..ccc1e72160 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,16 @@ +Thu Jan 7 19:10:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkviewport.c (gtk_viewport_style_set): Fixes + to drawing the background of the bin window + so that clearing and redrawing of child + widgets work properly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Juggle around + data so that if somebody triggers more redraw queuing + from a expose_event handler, it doesn't confuse the + heck out of GTK+. (But is highly liable to cause + an infinite loop...) + Thu Jan 7 12:31:41 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c (gtk_target_list_unref): Fix some diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 76af83356f..ccc1e72160 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +Thu Jan 7 19:10:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkviewport.c (gtk_viewport_style_set): Fixes + to drawing the background of the bin window + so that clearing and redrawing of child + widgets work properly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Juggle around + data so that if somebody triggers more redraw queuing + from a expose_event handler, it doesn't confuse the + heck out of GTK+. (But is highly liable to cause + an infinite loop...) + Thu Jan 7 12:31:41 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c (gtk_target_list_unref): Fix some diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 76af83356f..ccc1e72160 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,16 @@ +Thu Jan 7 19:10:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkviewport.c (gtk_viewport_style_set): Fixes + to drawing the background of the bin window + so that clearing and redrawing of child + widgets work properly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Juggle around + data so that if somebody triggers more redraw queuing + from a expose_event handler, it doesn't confuse the + heck out of GTK+. (But is highly liable to cause + an infinite loop...) + Thu Jan 7 12:31:41 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c (gtk_target_list_unref): Fix some diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 76af83356f..ccc1e72160 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +Thu Jan 7 19:10:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkviewport.c (gtk_viewport_style_set): Fixes + to drawing the background of the bin window + so that clearing and redrawing of child + widgets work properly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Juggle around + data so that if somebody triggers more redraw queuing + from a expose_event handler, it doesn't confuse the + heck out of GTK+. (But is highly liable to cause + an infinite loop...) + Thu Jan 7 12:31:41 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c (gtk_target_list_unref): Fix some diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 76af83356f..ccc1e72160 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +Thu Jan 7 19:10:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkviewport.c (gtk_viewport_style_set): Fixes + to drawing the background of the bin window + so that clearing and redrawing of child + widgets work properly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Juggle around + data so that if somebody triggers more redraw queuing + from a expose_event handler, it doesn't confuse the + heck out of GTK+. (But is highly liable to cause + an infinite loop...) + Thu Jan 7 12:31:41 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c (gtk_target_list_unref): Fix some diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 76af83356f..ccc1e72160 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +Thu Jan 7 19:10:21 1999 Owen Taylor <otaylor@redhat.com> + + * gtk/gtkviewport.c (gtk_viewport_style_set): Fixes + to drawing the background of the bin window + so that clearing and redrawing of child + widgets work properly. + + * gtk/gtkwidget.c (gtk_widget_idle_draw): Juggle around + data so that if somebody triggers more redraw queuing + from a expose_event handler, it doesn't confuse the + heck out of GTK+. (But is highly liable to cause + an infinite loop...) + Thu Jan 7 12:31:41 1999 Owen Taylor <otaylor@redhat.com> * gtk/gtkselection.c (gtk_target_list_unref): Fix some diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c index 80e7e6383d..0edc3a3b70 100644 --- a/gtk/gtkviewport.c +++ b/gtk/gtkviewport.c @@ -555,11 +555,16 @@ gtk_viewport_draw (GtkWidget *widget, gtk_viewport_paint (widget, &tmp_area); + tmp_area.x += viewport->hadjustment->value - widget->style->klass->xthickness; + tmp_area.y += viewport->vadjustment->value - widget->style->klass->ythickness; + + gtk_paint_flat_box(widget->style, viewport->bin_window, + GTK_STATE_NORMAL, GTK_SHADOW_NONE, + &tmp_area, widget, "viewportbin", + 0, 0, -1, -1); + if (bin->child) { - tmp_area.x += viewport->hadjustment->value - widget->style->klass->xthickness; - tmp_area.y += viewport->vadjustment->value - widget->style->klass->ythickness; - if (gtk_widget_intersect (bin->child, &tmp_area, &child_area)) gtk_widget_draw (bin->child, &child_area); } @@ -585,13 +590,22 @@ gtk_viewport_expose (GtkWidget *widget, if (event->window == widget->window) gtk_viewport_paint (widget, &event->area); + else if (event->window == viewport->bin_window) + { + child_event = *event; + + gtk_paint_flat_box(widget->style, viewport->bin_window, + GTK_STATE_NORMAL, GTK_SHADOW_NONE, + &event->area, widget, "viewportbin", + 0, 0, -1, -1); + + if ((bin->child != NULL) && + GTK_WIDGET_NO_WINDOW (bin->child) && + gtk_widget_intersect (bin->child, &event->area, &child_event.area)) + gtk_widget_event (bin->child, (GdkEvent*) &child_event); + } + - child_event = *event; - if ((event->window == viewport->bin_window) && - (bin->child != NULL) && - GTK_WIDGET_NO_WINDOW (bin->child) && - gtk_widget_intersect (bin->child, &event->area, &child_event.area)) - gtk_widget_event (bin->child, (GdkEvent*) &child_event); } return FALSE; @@ -688,10 +702,6 @@ gtk_viewport_size_allocate (GtkWidget *widget, child_allocation.y, child_allocation.width, child_allocation.height); - gtk_paint_flat_box(widget->style, viewport->bin_window, GTK_STATE_NORMAL, - GTK_SHADOW_NONE, - NULL, widget, "viewportbin", - 0, 0, -1, -1); } viewport->hadjustment->page_size = child_allocation.width; @@ -822,10 +832,6 @@ gtk_viewport_style_set (GtkWidget *widget, gtk_style_set_background (widget->style, viewport->bin_window, GTK_STATE_NORMAL); gtk_style_set_background (widget->style, widget->window, widget->state); - gtk_paint_flat_box(widget->style, viewport->bin_window, GTK_STATE_NORMAL, - GTK_SHADOW_NONE, - NULL, widget, "viewportbin", - 0, 0, -1, -1); if (GTK_WIDGET_DRAWABLE (widget)) { gdk_window_clear (widget->window); diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index fe9281e3ca..00ebb9039b 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -1661,6 +1661,8 @@ static GMemChunk *draw_data_mem_chunk = NULL; static GSList *draw_data_free_list = NULL; static const gchar *draw_data_key = "gtk-draw-data"; static GQuark draw_data_key_id = 0; +static const gchar *draw_data_tmp_key = "gtk-draw-data-tmp"; +static GQuark draw_data_tmp_key_id = 0; static gint gtk_widget_idle_draw (gpointer data); @@ -1955,18 +1957,39 @@ static gint gtk_widget_idle_draw (gpointer data) { GSList *widget_list; + GSList *old_queue; GSList *draw_data_list; GtkWidget *widget; + if (!draw_data_tmp_key_id) + draw_data_tmp_key_id = g_quark_from_static_string (draw_data_tmp_key); + GDK_THREADS_ENTER (); + + old_queue = gtk_widget_redraw_queue; + gtk_widget_redraw_queue = NULL; + + /* Translate all draw requests to be allocation-relative. + * At the same time, move all the data out of the way, + * so when we get down to the draw step, we can queue + * more information for "next time", if the application + * is that foolhardy. + */ + widget_list = old_queue; - /* Translate all draw requests to be allocation-relative */ - widget_list = gtk_widget_redraw_queue; while (widget_list) { widget = widget_list->data; draw_data_list = gtk_object_get_data_by_id (GTK_OBJECT (widget), draw_data_key_id); + gtk_object_set_data_by_id (GTK_OBJECT (widget), + draw_data_key_id, + NULL); + gtk_object_set_data_by_id (GTK_OBJECT (widget), + draw_data_tmp_key_id, + draw_data_list); + + GTK_PRIVATE_UNSET_FLAG (widget, GTK_REDRAW_PENDING); while (draw_data_list) { @@ -2009,15 +2032,15 @@ gtk_widget_idle_draw (gpointer data) widget_list = widget_list->next; } - /* Coalesce redraws + /* Coalesce redraws. */ - widget_list = gtk_widget_redraw_queue; + widget_list = old_queue; while (widget_list) { GSList *prev_node = NULL; widget = widget_list->data; draw_data_list = gtk_object_get_data_by_id (GTK_OBJECT (widget), - draw_data_key_id); + draw_data_tmp_key_id); while (draw_data_list) { @@ -2042,7 +2065,7 @@ gtk_widget_idle_draw (gpointer data) prev_node->next = draw_data_list->next; else gtk_object_set_data_by_id (GTK_OBJECT (widget), - draw_data_key_id, + draw_data_tmp_key_id, draw_data_list->next); tmp = draw_data_list->next; @@ -2082,7 +2105,7 @@ gtk_widget_idle_draw (gpointer data) if (parent && GTK_WIDGET_REDRAW_PENDING (parent)) parent_list = gtk_object_get_data_by_id (GTK_OBJECT (parent), - draw_data_key_id); + draw_data_tmp_key_id); else parent_list = NULL; } @@ -2107,19 +2130,17 @@ gtk_widget_idle_draw (gpointer data) /* Process the draws */ - widget_list = gtk_widget_redraw_queue; + widget_list = old_queue; while (widget_list) { widget = widget_list->data; draw_data_list = gtk_object_get_data_by_id (GTK_OBJECT (widget), - draw_data_key_id); + draw_data_tmp_key_id); gtk_object_set_data_by_id (GTK_OBJECT (widget), - draw_data_key_id, + draw_data_tmp_key_id, NULL); - GTK_PRIVATE_UNSET_FLAG (widget, GTK_REDRAW_PENDING); - while (draw_data_list) { GtkDrawData *data = draw_data_list->data; @@ -2138,8 +2159,7 @@ gtk_widget_idle_draw (gpointer data) widget_list = widget_list->next; } - g_slist_free (gtk_widget_redraw_queue); - gtk_widget_redraw_queue = NULL; + g_slist_free (old_queue); GDK_THREADS_LEAVE (); |