From e8c73bcb3758424617095b630405a3eae79cadcf Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 20 Apr 2024 18:20:17 +0000 Subject: [PATCH] app: [Wayland] suppress spurious ConfigEvents As reported By Larry Clapp, Wayland would send a ConfigEvent with every FrameEvent when fallback client side decorations are enabled. This is because Window would call the driver Option and Perform methods even when they're empty. The change applies to every platform, but was only observable on Wayland. Signed-off-by: Elias Naur --- app/window.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/window.go b/app/window.go index 7e88fad8..0ae470a3 100644 --- a/app/window.go +++ b/app/window.go @@ -769,8 +769,12 @@ func (w *Window) decorate(e FrameEvent, o *op.Ops) image.Point { } // Update the window based on the actions on the decorations. opts, acts := splitActions(deco.Update(gtx)) - w.driver.Configure(opts) - w.driver.Perform(acts) + if len(opts) > 0 { + w.driver.Configure(opts) + } + if acts != 0 { + w.driver.Perform(acts) + } style.Layout(gtx) // Offset to place the frame content below the decorations. decoHeight := gtx.Dp(w.decorations.Config.decoHeight)