app: fix automatic window decoration action processing

This commit adapts the use of the automatic window decorations to the
event processing changes introduced in v0.4.0. You must update widget
state before laying it out, not after. Doing so after (as this code used
to do) results in discarding updates.

Fixes: https://todo.sr.ht/~eliasnaur/gio/542
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
This commit is contained in:
Chris Waldon
2024-01-07 13:34:44 -05:00
parent 0073e1a167
commit 718be79d9e
+1 -1
View File
@@ -1036,9 +1036,9 @@ func (w *Window) decorate(d driver, e system.FrameEvent, o *op.Ops) (size, offse
Metric: e.Metric,
Constraints: layout.Exact(e.Size),
}
style.Layout(gtx)
// Update the window based on the actions on the decorations.
w.Perform(deco.Update(gtx))
style.Layout(gtx)
// Offset to place the frame content below the decorations.
decoHeight := gtx.Dp(w.decorations.Config.decoHeight)
if w.decorations.currentHeight != decoHeight {