From dc62058bcefc51bd138d12668bba5a11dfed3e3f Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sun, 1 Sep 2019 14:33:33 +0200 Subject: [PATCH] ui/app: (wayland) ensure DestroyEvent is the last event A ToplevelClose event could end in the same batch of events as another event, which will result in the other event being sent after a DestroyEvent. Window assumes no event will arrive after DestroyEvent, so ensure that property for the Wayland backend. Signed-off-by: Elias Naur --- ui/app/os_wayland.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/os_wayland.go b/ui/app/os_wayland.go index 9e1af02c..571e8f24 100644 --- a/ui/app/os_wayland.go +++ b/ui/app/os_wayland.go @@ -310,7 +310,6 @@ func gio_onXdgSurfaceConfigure(data unsafe.Pointer, wmSurf *C.struct_xdg_surface func gio_onToplevelClose(data unsafe.Pointer, topLvl *C.struct_xdg_toplevel) { w := winMap[topLvl] w.dead = true - w.w.event(DestroyEvent{}) } //export gio_onToplevelConfigure @@ -772,6 +771,7 @@ loop: break } if w.dead { + w.w.event(DestroyEvent{}) break } // Clear poll events.