gtk+ r21399 - in trunk: . gtk



Author: matthiasc
Date: Tue Sep 16 04:51:56 2008
New Revision: 21399
URL: http://svn.gnome.org/viewvc/gtk+?rev=21399&view=rev

Log:
2008-09-16  Matthias Clasen  <mclasen redhat com>

        Bug 551987 â GtkPaned redrawing problem

        * gtk/gtkhpaned.c:
        * gtk/gtkvpaned.c: Queue invalidations when the handle is moved
        due to child changes. Patch by Owen Taylor



Modified:
   trunk/ChangeLog
   trunk/gtk/gtkhpaned.c
   trunk/gtk/gtkvpaned.c

Modified: trunk/gtk/gtkhpaned.c
==============================================================================
--- trunk/gtk/gtkhpaned.c	(original)
+++ trunk/gtk/gtkhpaned.c	Tue Sep 16 04:51:56 2008
@@ -130,6 +130,7 @@
       GtkAllocation child2_allocation;
       GtkRequisition child1_requisition;
       GtkRequisition child2_requisition;
+      GdkRectangle old_handle_pos;
       gint handle_size;
       
       gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
@@ -143,6 +144,8 @@
 				       - 2 * border_width),
 				  child1_requisition.width,
 				  child2_requisition.width);
+
+      old_handle_pos = paned->handle_pos;
       
       paned->handle_pos.x = widget->allocation.x + paned->child1_size + border_width;
       paned->handle_pos.y = widget->allocation.y + border_width;
@@ -164,6 +167,14 @@
 	  flip_child (widget, &(paned->handle_pos));
 	}
       
+      if (GTK_WIDGET_MAPPED (widget) &&
+	  (old_handle_pos.x != paned->handle_pos.x || old_handle_pos.y != paned->handle_pos.y ||
+	   old_handle_pos.width != paned->handle_pos.width || old_handle_pos.height != paned->handle_pos.height))
+	{
+	  gdk_window_invalidate_rect (widget->window, &old_handle_pos, FALSE);
+	  gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE);
+	}
+
       if (GTK_WIDGET_REALIZED (widget))
 	{
 	  if (GTK_WIDGET_MAPPED (widget))

Modified: trunk/gtk/gtkvpaned.c
==============================================================================
--- trunk/gtk/gtkvpaned.c	(original)
+++ trunk/gtk/gtkvpaned.c	Tue Sep 16 04:51:56 2008
@@ -125,6 +125,7 @@
       GtkRequisition child2_requisition;
       GtkAllocation child1_allocation;
       GtkAllocation child2_allocation;
+      GdkRectangle old_handle_pos;
       gint handle_size;
       
       gtk_widget_style_get (widget, "handle-size", &handle_size, NULL);
@@ -139,11 +140,21 @@
 				  child1_requisition.height,
 				  child2_requisition.height);
 
+      old_handle_pos = paned->handle_pos;
+
       paned->handle_pos.x = widget->allocation.x + border_width;
       paned->handle_pos.y = widget->allocation.y + paned->child1_size + border_width;
       paned->handle_pos.width = MAX (1, (gint) widget->allocation.width - 2 * border_width);
       paned->handle_pos.height = handle_size;
       
+      if (GTK_WIDGET_MAPPED (widget) &&
+	  (old_handle_pos.x != paned->handle_pos.x || old_handle_pos.y != paned->handle_pos.y ||
+	   old_handle_pos.width != paned->handle_pos.width || old_handle_pos.height != paned->handle_pos.height))
+	{
+	  gdk_window_invalidate_rect (widget->window, &old_handle_pos, FALSE);
+	  gdk_window_invalidate_rect (widget->window, &paned->handle_pos, FALSE);
+	}
+
       if (GTK_WIDGET_REALIZED (widget))
 	{
 	  if (GTK_WIDGET_MAPPED (widget))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]