From 915f2c5e5991888d8237c1ecee09bda825c20d39 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 5 Feb 1999 15:48:25 +0000 Subject: Don't assume any more that the gtkwidget.c code will queue a redraw on us 1999-02-05 Owen Taylor * gtk/gtk[hv]paned.c (gtk_[hv]paned_size_allocate): Don't assume any more that the gtkwidget.c code will queue a redraw on us during a size_allocate - queue clear/draws as appropriate for our groove. --- gtk/gtkhpaned.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'gtk/gtkhpaned.c') diff --git a/gtk/gtkhpaned.c b/gtk/gtkhpaned.c index 333ed76ab8..1eac179b85 100644 --- a/gtk/gtkhpaned.c +++ b/gtk/gtkhpaned.c @@ -133,6 +133,7 @@ gtk_hpaned_size_allocate (GtkWidget *widget, GtkPaned *paned; GtkAllocation child1_allocation; GtkAllocation child2_allocation; + GdkRectangle old_groove_rectangle; guint16 border_width; g_return_if_fail (widget != NULL); @@ -165,26 +166,37 @@ gtk_hpaned_size_allocate (GtkWidget *widget, gdk_window_move (paned->handle, paned->handle_xpos, paned->handle_ypos); } - if (GTK_WIDGET_MAPPED (widget)) - { - gdk_window_clear_area (widget->window, - paned->groove_rectangle.x, - paned->groove_rectangle.y, - paned->groove_rectangle.width, - paned->groove_rectangle.height); - } - child1_allocation.height = child2_allocation.height = MAX (1, (gint)allocation->height - border_width * 2); child1_allocation.width = paned->child1_size; child1_allocation.x = border_width; child1_allocation.y = child2_allocation.y = border_width; + old_groove_rectangle = paned->groove_rectangle; + paned->groove_rectangle.x = child1_allocation.x + child1_allocation.width + paned->gutter_size / 2 - 1; paned->groove_rectangle.y = 0; paned->groove_rectangle.width = 2; paned->groove_rectangle.height = allocation->height; + if (GTK_WIDGET_DRAWABLE (widget) && + ((paned->groove_rectangle.x != old_groove_rectangle.x) || + (paned->groove_rectangle.y != old_groove_rectangle.y) || + (paned->groove_rectangle.width != old_groove_rectangle.width) || + (paned->groove_rectangle.height != old_groove_rectangle.height))) + { + gtk_widget_queue_clear_area (widget, + old_groove_rectangle.x, + old_groove_rectangle.y, + old_groove_rectangle.width, + old_groove_rectangle.height); + gtk_widget_queue_draw_area (widget, + paned->groove_rectangle.x, + paned->groove_rectangle.y, + paned->groove_rectangle.width, + paned->groove_rectangle.height); + } + child2_allocation.x = paned->groove_rectangle.x + paned->gutter_size / 2 + 1; child2_allocation.width = MAX (1, (gint)allocation->width - child2_allocation.x - border_width); -- cgit v1.2.1