Re: [gtk-list] [patch] resize queuing



On 24 Sep 1997, Owen Taylor wrote:

> 
> This patch fixes some things with queuing resizes.
> 
> * When a widget is destroyed, it needs to be removed from the list of
>   pending resizes. (gtkwidget.c)

this is done by gtk-timj-970919-0.patch.gz, and some else important fixes
regarding the queued resizing and redrawing.

> * In gtk_widget_show(), the widget should be the argument to 
>   gtk_widget_queue_resize not the parent. (gtkwidget.c)
> * When processing queued resizes, there may be some widgets
>   without parents. These should be ignored.
> 
> These patches fix up a problem that was causing the GIMP's dbbrowser
> to crash. (A sequence of gtk_widget_hide(), gtk_widget_destroy())
> (Some of this stuff wasn't directly the culprit, but was found
> while looking around).

what version of gimp are you using? 0.99.11 has gtk-timj-970919-0.patch.gz
incorporated, wich get's around the problem of subsequent calls to
gtk_widget_hide() and gtk_widget_destroy().

> 
> On a similar note, shouldn't widgets be ref'd and unref'd while
> a draw is pending so that they can't be destroyed in the
> meantime?

well if not, the redrawing might segfault. i had that happening, which 
is why i removed widgets that are going to be destroyed from the redrawing
queue.

> 
> Regards,
>                                         Owen
> 
> 

[...]
>   void
>   gtk_widget_destroy (GtkWidget *widget)
>   {
> +   gtk_widget_unqueue_resize (widget);

here needs to be more done than the unqueueing for resizes...

>     if (widget->parent)
>       {
>         if (!GTK_OBJECT_BEING_DESTROYED (widget->parent))
> ***************
> *** 1891,1903 ****
>     if (height > -1)
>       aux_info->height = height;
>   
> !   if (GTK_WIDGET_VISIBLE (widget))
> !     {
> !       if (widget->parent && GTK_WIDGET_VISIBLE (widget->parent))
> ! 	gtk_widget_queue_resize (GTK_WIDGET (widget->parent));
> !       else if (GTK_IS_CONTAINER (widget))
> ! 	gtk_widget_queue_resize (widget);
> !     }
>   }
>   
>   /*****************************************
> --- 1894,1901 ----
>     if (height > -1)
>       aux_info->height = height;
>   
> !   if (GTK_WIDGET_VISIBLE (widget) && widget->parent)
> !     gtk_widget_queue_resize (widget);
>   }
>   

ok, this i didn't have in the patch...


owen, could you please read again my announcement of gtk-timj-970919.patch,
and then send a diff against gtk+ from 0.99.11, or
at least gtk+970916 + gtk-timj-970919.patch ?
(before i announced that patch, i sent a mail to this list that tried to half
fix the problems just like your mail did, but the queues worked fine for me
and a lot of else people with gtk-timj-970919.patch applied).


---
ciaoTJ



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