From 101b65f4e5500f78bbe3c4336d017f292a196e16 Mon Sep 17 00:00:00 2001 From: Konstantin Kulikov Date: Thu, 14 Nov 2019 05:48:26 +0300 Subject: [PATCH] app/internal/window: map window after defining WM protocols ICCCM 4.1.2 says WMs will examine client properties every time window is mapped. Because SetWMProtocols is called before MapWindow some WMs (specifically taowm) never see them. In other WMs this works because they check for WM_DELETE_WINDOW when user tries to close window, not when window is mapped. Signed-off-by: Konstantin Kulikov --- app/internal/window/os_x11.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go index 7f69b362..d4d69873 100644 --- a/app/internal/window/os_x11.go +++ b/app/internal/window/os_x11.go @@ -528,9 +528,6 @@ func newX11Window(gioWin Callbacks, opts *Options) error { hints.flags = C.InputHint C.XSetWMHints(dpy, win, &hints) - // make the window visible on the screen - C.XMapWindow(dpy, win) - // set the name ctitle := C.CString(opts.Title) defer C.free(unsafe.Pointer(ctitle)) @@ -549,6 +546,9 @@ func newX11Window(gioWin Callbacks, opts *Options) error { w.evDelWindow = w.atom("WM_DELETE_WINDOW", false) C.XSetWMProtocols(dpy, win, &w.evDelWindow, 1) + // make the window visible on the screen + C.XMapWindow(dpy, win) + go func() { w.w.SetDriver(w) w.setStage(system.StageRunning)