[haiku-commits] Re: r41772 - haiku/trunk/src/apps/showimage

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 27 May 2011 22:15:20 +0200

"Ingo Weinhold" <ingo_weinhold@xxxxxx> wrote:
> axeld@xxxxxxxxxxxxxxxx wrote:
> > * We obviously need to relayout manually, as it looks like the view
> > is not
> >  layouted correctly after the resize. This fixes bug #7577. Ingo,
> > is this
> >  the desired behaviour of the layout engine, and if so, what's the
> > rationale
> >  behind it?
> You'll have to be a bit more specific for me to answer. From the
> comment in the
> patch ...

Since that is part of the commit message, I thought you would get the
idea ;-)

> > + GetLayout()->Relayout(true);
> > + // We need to manually relayout here, as the views would be
> > relayouted
> > + // later, and FitToBounds() would still have the wrong size
> >   fImageView->FitToBounds();
> ... I suppose a view or window is resized and some descendant is
> assumed to
> already have the newly laid out size. Since the relayout happens
> asynchronously
> that assumption is incorrect. Layout invalidation and relayouting
> work analogously
> to graphics invalidation and redrawing and for the same reasons.

A window is resized. And the same reasons are because of batching up
pending requests?

> BTW, BLayout::Relayout() is not supposed to be called directly. BView
> has
> methods (Layout()/Relayout()) for that purpose, for the window those
> are
> missing yet, though.

Should I add them, or rather call Layout()->View()->Relayout()?
IIRC Relayout() didn't work, but Layout() did (I've tried them all, but
thought that calling it on the layout would be nicer, since you are not
really supposed to mess with the top view). Would really be great to
have some documentation for this 8-)

Bye,
   Axel.


Other related posts: