Re: bug in gtklayout? (take two)




rfg@home.se writes:

> The code below displays a arrow when run.
> 
> When you press the button, then the arrow should disappear
> because of the gtk_widget_hide() call and another appear.
> But the arrow don't disappear until the window is redrawn
> (for example by moving another window over it with the mouse).

Thanks for the report. This turned up some fairly long-standing
bugs in the redraw-queueing code.

                                        Owen

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.1061.2.144
diff -u -r1.1061.2.144 ChangeLog
--- ChangeLog	1999/09/10 19:18:59	1.1061.2.144
+++ ChangeLog	1999/09/13 18:55:13
@@ -1,3 +1,14 @@
+Mon Sep 13 15:01:21 1999  Owen Taylor  <otaylor@redhat.com>
+
+	* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
+	queues of areas that are completely off screen.
+
+	* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
+	logic for handleboxes.
+
+	* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
+	check on width/height.
+
 Fri Sep 10 15:22:50 1999  Owen Taylor  <otaylor@redhat.com>
 
 	* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
Index: gtk/gtkwidget.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwidget.c,v
retrieving revision 1.147.2.12
diff -u -r1.147.2.12 gtkwidget.c
--- gtk/gtkwidget.c	1999/09/03 03:57:14	1.147.2.12
+++ gtk/gtkwidget.c	1999/09/13 18:55:13
@@ -1734,6 +1734,7 @@
   GtkDrawData *data;
   
   g_return_if_fail (widget != NULL);
+  g_return_if_fail (!(width < 0 || height < 0) || window == NULL);
 
   if ((width != 0) && (height != 0) && GTK_WIDGET_DRAWABLE (widget))
     {
@@ -1864,6 +1865,10 @@
 	  y -= wy - widget->allocation.y;
 	  
 	  gdk_window_get_size (widget->window, &wwidth, &wheight);
+
+	  if (x + width <= 0 || y + height <= 0 ||
+	      x >= wwidth || y >= wheight)
+	    return;
 	  
 	  if (x < 0)
 	    {
@@ -2083,23 +2088,23 @@
 						       NULL, NULL);
 	      data->window = NULL;
 	    }
-	  else
+	  else if ((data->rect.width == 0) && (data->rect.height == 0))
+	    full_allocation = TRUE;
+
+	  if (full_allocation)
 	    {
-	      if ((data->rect.width == 0) && (data->rect.height == 0))
+	      if (GTK_WIDGET_NO_WINDOW (widget))
 		{
-		  if (GTK_WIDGET_NO_WINDOW (widget))
-		    {
-		      data->rect.x = widget->allocation.x;
-		      data->rect.y = widget->allocation.y;
-		    }
-		  else
-		    {
-		      data->rect.x = 0;
-		      data->rect.y = 0;
-		    }
-		  data->rect.width = widget->allocation.width;
-		  data->rect.height = widget->allocation.height;
+		  data->rect.x = widget->allocation.x;
+		  data->rect.y = widget->allocation.y;
 		}
+	      else
+		{
+		  data->rect.x = 0;
+		  data->rect.y = 0;
+		}
+	      data->rect.width = widget->allocation.width;
+	      data->rect.height = widget->allocation.height;
 	    }
 
 	  draw_data_list = draw_data_list->next;



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