forked from joejulian/gio
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:
+1
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user