Re: reparenting containers with a window of t




Patrice Fortier <Patrice.Fortier@aquarel.fr> writes:

> > > > The quick solution, which may help in other cases is to then
> > > > modify gdk_widget_realize() to unrealize the children (before
> > >          ^^^^^^^^^^^^^^^^^^^  you mean gtk_widget_unrealize here?
> > > > it unrealizes the main widget)
> 
> Is this a joke?
> 
> You mean that when you want to reparent a widget, you unmap it,
> then unrealize it (destroy it), rerealize it (create it) with
> an other parent, and then remap it!???!
> And you'd like to do that trick recursively???
> I can't even believe that *you* wrote this!
> 
> There are a REPARENT X event and an XReparentWindow function for
> that.
> Why don't you use it?

When possible I do. 

"When possible" means:
   
    GTK_WIDGET_REALIZED (widget) && GTK_WIDGET_REALIZED (new_parent)

I'd like you see do better than that! (Actually, if the widget
is a container without a window, then we may have to do multiple
gdk_window_reparent()'s - but that again is unavoidable)

> Why do you send dozens of X events (un/map un/realize...), allocate/
> deallocate memory for the windows and widgets when all you have to
> do is send 1 event, calling XReparentWindow (which tells X to do
> the job)?
> 
> <...>
> 
> > > > This doesn't get us the gdk_window reparent behavior back, though.
> > With the expense of one flag, I've gotten so it does the
> > gtk_widget_reparenting (or just adjusting widget->window for
> > NO_WINDOW widgets) when possible, and realizes/unrealizes
> > otherwise.
> 
> I wanna die...

Don't hurry. I think the current code is effficient as possible.

Regards,
                                        Owen



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