Files
gio/ui/app/internal
Elias Naur bdd6b32711 ui/app/internal/input: schedule an extra frame after event delivery
A program might choose to process events that affect UI state already laid out.
For example, a button click might switch to a completely different UI page, but
the click might be processed during the drawing of the current page.

Avoiding that require either processing events very early during layout or
adding InvalidateOps whenever events are handled late.

Early event processing is awkward and InvalidateOps are easy to forget and
their absence masked by any other cause of redraw.

This change adds an implicit InvalidateOp for each frame where events have been
delivered to the program, allowing late event handling without use of
InvalidateOps.

In the worst case we waste a frame, increasing power use. I hope that future
optimizations will detect and discard the duplicate frame before it reaches
the GPU.

A similar situation applies to the delayed delivery of Editor events, but
since Editor.Layout flushes remaining events, extra InvalidateOps are not
required. Add a comment.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-09-26 18:58:25 +02:00
..