Re: gtkwindow changes



On 17 Aug 2001, Havoc Pennington wrote:

> 
> Hi,
> 
> Hang on - why do you have a GTK_RESIZE_IMMEDIATE toplevel?  I hope
> this is on an override redirect window at least? It's really broken
> for a managed window. We can't resize until we get configure notify.

the only reason we cannot is gdk_window_resize(toplevel) not taking
over the new width/height right away, and i don't see a good reason for
it doing that.
in general GTK_RESIZE_IMMEDIATE should work fine for any container,
including toplevels, as i replied to owen, code shouldn't rely on
resizing occouring asyncronously (at least up to now, if we want to
change that for the future, that's a different story).

> >       if (container->resize_mode == GTK_RESIZE_QUEUE)
> >         {
> >           gtk_widget_queue_resize (widget);
> >           _gtk_container_dequeue_resize_handler (container);
> >         }
> > +     else /* GTK_RESIZE_IMMEDIATE */
> > +       {
> > +         GtkAllocation allocation = { newwidth, newheight };
> > +         gtk_widget_size_allocate (widget, &allocation);
> > +         gtk_widget_queue_draw (widget);
> > +       }
> 
> This would be OK for override redirect windows,

no it can't be ok for any type of window as long as gdk_window_resize(toplevel)
doesn't store away newwidth/newheight.

> > can't yield correct results either, since gdk_window_resize(toplevelwindow)
> > doesn't poke the new width and height into GdkWindow until a configure
> > event is received, so drawing code that querries width/height from the
> > gdkwindow instead of widget->allocation will break.
> 
> And updating the GdkWindow size immediately would also be OK for
> override redirect windows.

can you explain why you think override redirect windows should be any
different here than normal windows?

> But using GTK_RESIZE_IMMEDIATE for a managed window makes no sense to
> me at all.

GTK_RESIZE_IMMEDIATE is actually about resizing speed, unrelated to
configure event handling in gtkwindow.c code. there's no particular reason
for GLE selector to be GTK_RESIZE_IMMEDIATE other than that way i got
at least one window that tests whether GTK_RESIZE_IMMEDIATE still works
in gtk.

> 
> Havoc
> 

---
ciaoTJ





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