]> Pileus Git - ~andy/gtk/commitdiff
always update the bin_window position and size in size_allocate, even if
authorTim Janik <timj@imendio.com>
Wed, 20 Sep 2006 15:02:01 +0000 (15:02 +0000)
committerTim Janik <timj@src.gnome.org>
Wed, 20 Sep 2006 15:02:01 +0000 (15:02 +0000)
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.

ChangeLog
gtk/gtkscrolledwindow.c
gtk/gtkviewport.c

index a772038b3c3e9b15fe1179ce6b0cdfa85bd67d25..e93961289d2e03af16ac4f15e19298a59b2e2f48 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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.
+
 2006-09-19  Ryan Lortie  <desrt@desrt.ca>
 
        * docs/reference/gdk/gdk-sections.txt:
index a1b59b8e19aab33f7aefedadd3754e060e9ea0ed..d130b399ad114a3fd4f6f66311b7e9b0422c8dd9 100644 (file)
@@ -1348,7 +1348,11 @@ gtk_scrolled_window_size_allocate (GtkWidget     *widget,
             previous_vvis != scrolled_window->vscrollbar_visible);
     }
   else
-    gtk_scrolled_window_relative_allocation (widget, &relative_allocation);
+    {
+      scrolled_window->hscrollbar_visible = scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS;
+      scrolled_window->vscrollbar_visible = scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS;
+      gtk_scrolled_window_relative_allocation (widget, &relative_allocation);
+    }
   
   if (scrolled_window->hscrollbar_visible)
     {
index 3d18da0c2c0088fa01f7df24d9bbee317ea9271a..eb123094c9649fcad9c073539869ecd930dbf7dd 100644 (file)
@@ -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);