From 718be79d9edce50328a65ebc1053d2986352a6bd Mon Sep 17 00:00:00 2001 From: Chris Waldon Date: Sun, 7 Jan 2024 13:34:44 -0500 Subject: [PATCH] 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 --- app/window.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/window.go b/app/window.go index 78feb555..a38e7406 100644 --- a/app/window.go +++ b/app/window.go @@ -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 {