summaryrefslogtreecommitdiff
path: root/gtk/gtkviewport.c
diff options
context:
space:
mode:
authorTim Janik <timj@imendio.com>2006-09-20 15:02:01 +0000
committerTim Janik <timj@src.gnome.org>2006-09-20 15:02:01 +0000
commit00bfb206eecfa3191063ed3bbf99370ce1770d7c (patch)
tree551f6e72579a3048d17ab1af80a3de02198035e8 /gtk/gtkviewport.c
parent6893f3ef08e5dfd9d4cec0e405f9a30cdc83344f (diff)
downloadgtk+-00bfb206eecfa3191063ed3bbf99370ce1770d7c.tar.gz
always update the bin_window position and size in size_allocate, even if
Wed Sep 20 16:59:38 2006 Tim Janik <timj@imendio.com> * gtk/gtkviewport.c: always update the bin_window position and size in size_allocate, even if we don't have a visible child. this fixes expose artefacts as described in #313508. * gtk/gtkscrolledwindow.c: make hiding of automatic scrollbars when we have no visible child explicit.
Diffstat (limited to 'gtk/gtkviewport.c')
-rw-r--r--gtk/gtkviewport.c40
1 files changed, 15 insertions, 25 deletions
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 3d18da0c2c..eb123094c9 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -734,9 +734,9 @@ gtk_viewport_size_allocate (GtkWidget *widget,
GtkBin *bin = GTK_BIN (widget);
gint border_width = GTK_CONTAINER (widget)->border_width;
gboolean hadjustment_value_changed, vadjustment_value_changed;
-
GtkAdjustment *hadjustment = gtk_viewport_get_hadjustment (viewport);
GtkAdjustment *vadjustment = gtk_viewport_get_vadjustment (viewport);
+ GtkAllocation child_allocation;
/* If our size changed, and we have a shadow, queue a redraw on widget->window to
* redraw the shadow correctly.
@@ -748,47 +748,37 @@ gtk_viewport_size_allocate (GtkWidget *widget,
gdk_window_invalidate_rect (widget->window, NULL, FALSE);
widget->allocation = *allocation;
-
+
viewport_set_hadjustment_values (viewport, &hadjustment_value_changed);
viewport_set_vadjustment_values (viewport, &vadjustment_value_changed);
-
+
+ child_allocation.x = 0;
+ child_allocation.y = 0;
+ child_allocation.width = hadjustment->upper;
+ child_allocation.height = vadjustment->upper;
if (GTK_WIDGET_REALIZED (widget))
{
GtkAllocation view_allocation;
-
- viewport_get_view_allocation (viewport, &view_allocation);
-
gdk_window_move_resize (widget->window,
allocation->x + border_width,
allocation->y + border_width,
allocation->width - border_width * 2,
allocation->height - border_width * 2);
-
+
+ viewport_get_view_allocation (viewport, &view_allocation);
gdk_window_move_resize (viewport->view_window,
view_allocation.x,
view_allocation.y,
view_allocation.width,
view_allocation.height);
+ gdk_window_move_resize (viewport->bin_window,
+ - hadjustment->value,
+ - vadjustment->value,
+ child_allocation.width,
+ child_allocation.height);
}
-
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
- {
- GtkAllocation child_allocation;
-
- child_allocation.x = 0;
- child_allocation.y = 0;
- child_allocation.width = hadjustment->upper;
- child_allocation.height = vadjustment->upper;
-
- if (GTK_WIDGET_REALIZED (widget))
- gdk_window_move_resize (viewport->bin_window,
- - hadjustment->value,
- - vadjustment->value,
- child_allocation.width,
- child_allocation.height);
-
- gtk_widget_size_allocate (bin->child, &child_allocation);
- }
+ gtk_widget_size_allocate (bin->child, &child_allocation);
gtk_adjustment_changed (hadjustment);
gtk_adjustment_changed (vadjustment);