Re: Size allocation and redrawing issues
- From: Tim Janik <timj gtk org>
- To: Owen Taylor <otaylor redhat com>
- Cc: Gtk+ Developers <gtk-devel-list gnome org>, blizzard redhat com
- Subject: Re: Size allocation and redrawing issues
- Date: Mon, 5 Nov 2001 01:33:22 +0100 (CET)
On 3 Nov 2001, Owen Taylor wrote:
> There are some issues here we need to think through in terms
> of how requisition and allocation relate to the state of
> widgets, in particular to it being:
>
> - Parent set
> - Anchored
> - Realized
> - style ensured
> - visible
> - mapped
> - viewable (anchored and all parents visible)
>
> In terms of requisition, there are basically three conditions:
>
> R1) "requisition not meaingful"
> R2) "requisition meaingful, but we don't put the widget
> in the resize queue for resize if it changes"
> R3) "We update the requisition through the resize queue"
>
> For allocation, the conditions are:
>
> A1) We can't call size_allocate()
> A2) We can call size_allocate()
> A3) "We update the requisition through the resize queue"
>
> I believe that the conditions are:
>
> R1,A1)
> R2,A2) Widget is anchored (note that to call size_request()
> we need to ensure the style, but that can be done
> at any point when the widget is anchored)
> R3,A3) Widget is viewable
>
> So, it seems to me that the corresponding flag/resize queue
> requirements are only:
>
> R1 => R2 : Set ALLOC_NEEDED, RESIZE_NEEDED
> R2 => R3 : If ALLOC_NEEDED or RESIZE_NEEDED is set queue
> for resize
>
> (the current logic isn't really close to this, though I
> think it works out that from R1=>R3 we will set ALLOC_NEEDED
> and RESIZE_NEEDED and queue for resize)
>
> On the reverse transitions:
>
> R3 => R2 : "Unqueue for resize" isn't needed since
> parent widgets won't allocate non-visible
> children.
> R2 => R1 : "Clear ALLOC_NEEDED RESIZE_NEEDED" flags. Not
> necessary since the flags are meaningless
> in R1.
i don't quite agree with the rest here.
for viewable widgets, ALLOC_NEEDED/RESIZE_NEEDED always means that
the widget either is queued for a resize, or has a container that
is queued for a resize (your code relies on that, e.g. when walking
up widget->parent in a loop and breaks on a parent that has ALLOC_NEEDED/
RESIZE_NEEDED set on it).
so as a result, i'd say that non-viewable widets should never have
any of those flags set, if we don't honour that, we'll mess up things
earlier or later and introduce subtle to track bugs.
>
> Regards,
> Owen
>
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]