Re: gtk_window_set_transient_for bug




Lance Capser <lmc@cyberhighway.net> writes:

> Greetings, Programs!
> 
>     I think I've found a bug in gtkwindow.c in the _set_transient_for
> routines.  Basically, if you call gtk_window_set_transient_for() for a
> given window, then call it again, it is supposed to remove the previous
> transient_parent and set the new parent.  The code here:
> 
> 
>        if (window->transient_parent)
>          {
>            gtk_window_unset_transient_for (window);
> 
>            if (GTK_WIDGET_REALIZED (window) &&
>         GTK_WIDGET_REALIZED (window->transient_parent) &&
>         (!parent || !GTK_WIDGET_REALIZED (parent)))
>       gtk_window_transient_parent_unrealized (GTK_WIDGET
>      (window->transient_parent),
>            GTK_WIDGET (window));
>          }
> 
> calls gtk_window_unset_transient_for on the window, then checks if the
> parent window is unrealized.  The problem here lies in that
> gtk_window_unset_transient_for sets window->transient_parent to NULL
> *before* the unrealized call.  I've included a patch that moves the
> gtk_window_unset_transient_for call after the parent_realized check . .
> . seems to work for me (I'm not all that familiar with the gtk
> internals, but this was a pretty simple SEGV to find . . .)

Patch applied. Thanks.
                                        Owen



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