summaryrefslogtreecommitdiff
path: root/gtk/gtkhpaned.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@gtk.org>1999-02-05 15:48:25 +0000
committerOwen Taylor <otaylor@src.gnome.org>1999-02-05 15:48:25 +0000
commit915f2c5e5991888d8237c1ecee09bda825c20d39 (patch)
treefc00013c085c8d1e034dfb862199ddc88fbfaa35 /gtk/gtkhpaned.c
parent674b23e434415d3f407fcc55debfc47223c97cca (diff)
downloadgdk-pixbuf-915f2c5e5991888d8237c1ecee09bda825c20d39.tar.gz
Don't assume any more that the gtkwidget.c code will queue a redraw on us
1999-02-05 Owen Taylor <otaylor@gtk.org> * 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.
Diffstat (limited to 'gtk/gtkhpaned.c')
-rw-r--r--gtk/gtkhpaned.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/gtk/gtkhpaned.c b/gtk/gtkhpaned.c
index 333ed76ab..1eac179b8 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);