dragging bug caused by fix for GtkInvisible style attach leak



on 12/18/00 5:13 AM, Alexander Larsson at alla lysator liu se wrote:

> Destroying a GtkInvisible eventually results in it becoming unrealized and
> it's widget->style to be detached. But gtk_invisible_realize doesn't
> attach the style (it really doesn't need any frickin style), this makes
> the widget style attach counter to decrease by one each time a
> GtkInvisible is unrealized, and eventually the style will be destroyed
> while there are still references to it.
> 
> Here is a patch that just attaches the style. This is a bit wasteful,
> since it is not needed, but it is a simple way to fix the problem.
> 
> This bug is probably in Gtk+ 1.2.x too.
> 
> / Alex
> 
> Index: gtkinvisible.c
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gtk/gtkinvisible.c,v
> retrieving revision 1.8
> diff -u -p -r1.8 gtkinvisible.c
> --- gtkinvisible.c 2000/12/11 16:43:47 1.8
> +++ gtkinvisible.c 2000/12/18 13:05:59
> @@ -134,6 +134,8 @@ gtk_invisible_realize (GtkWidget *widget
> 
>    widget->window = gdk_window_new (NULL, &attributes, attributes_mask);
>    gdk_window_set_user_data (widget->window, widget);
> +
> +  widget->style = gtk_style_attach (widget->style, widget->window);
> }
> 
> static void

A version of this was committed to the GTK stable branch. Since then, we've
had a number of people reporting warnings when dragging in Nautilus. It took
me while a notice the pattern (people using GTK stable head) and to realize
it was due to the GTK change, not a Nautilus change.

It turns out that there's a GtkInvisible created by the DnD code. When it's
realized, the fact that the colormap is NULL results in assertion failures.
I'm no expert in this part of the GTK code, so it's not obvious to me what
should be fixed.

    -- Darin





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