From d03f6186607067ba04a09689711c6987a1bf7b68 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 3 Sep 2021 12:11:55 +0200 Subject: [PATCH] app: [Windows] avoid deadlock when changing window configuration Some window configurations lead to WM_SIZE messages when changed, which leads to deadlock because our window proc is not re-entrant. Avoid the issues by ignoring redundant messages. Fixes gio#262 Signed-off-by: Elias Naur --- app/os_windows.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/os_windows.go b/app/os_windows.go index 2fcf62a4..1bdacb76 100644 --- a/app/os_windows.go +++ b/app/os_windows.go @@ -444,8 +444,10 @@ func (w *window) Wakeup() { } func (w *window) setStage(s system.Stage) { - w.stage = s - w.w.Event(system.StageEvent{Stage: s}) + if s != w.stage { + w.stage = s + w.w.Event(system.StageEvent{Stage: s}) + } } func (w *window) draw(sync bool) {