Re: GTK+ redraw programs



On Mon, 6 Sep 1999, Tim Janik wrote:

> On 6 Sep 1999, Owen Taylor wrote:
> 
> > 
> > [ resend to get the headers right. You'd think that _I'd_ know
> >   that gtk-devel-list was @redhat.com. Sorry about that  ]
> > 
> > Hi guys,
> > 
> > Could you try out the following patch to gtkwidget.c. I have
> > a hunch that what is happening is that expose events on widgets
> > that get queued for resize after the initial show are getting
> > discarded.
> 
> yes, and that is right because widgets that are queued for resizes
> are also queued for a redraw (which opposed to expose events will
> redraw recursively if the widget is a container), that's the whole
> point of the expose event discarding code.
> if this fix actually matters for people, it means that we have
> problems in the redraw queue.

and indeed, there is a redraw problem with widgets queued for resizes.
one constrain is that NEED_RESIZE widgets have a redraw pending on
them, but in fact, gtk_widget_queue_resize() queues the redraw on
the child and the resize on the parent.

Bruce and Mikael, could you check whether this patch fixes stuff
for you?
(Michael if that is not the case, i'd still like to get the expose
event log from testgtk)

--- gtkwidget.c.orig    Mon Sep  6 20:58:53 1999
+++ gtkwidget.c Tue Sep  7 00:30:13 1999
@@ -2255,13 +2255,16 @@
   if (GTK_IS_RESIZE_CONTAINER (widget))
     gtk_container_clear_resize_widgets (GTK_CONTAINER (widget));

-  if (GTK_WIDGET_DRAWABLE (widget))
-    gtk_widget_queue_clear (widget);
-
   if (widget->parent)
-    gtk_container_queue_resize (GTK_CONTAINER (widget->parent));
+    {
+      gtk_widget_queue_clear (widget->parent);
+      gtk_container_queue_resize (GTK_CONTAINER (widget->parent));
+    }
   else if (GTK_WIDGET_TOPLEVEL (widget))
-    gtk_container_queue_resize (GTK_CONTAINER (widget));
+    {
+      gtk_widget_queue_clear (widget);
+      gtk_container_queue_resize (GTK_CONTAINER (widget));
+    }
 }

 /*****************************************


---
ciaoTJ




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