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 <k.kulikov2@gmail.com>
This commit is contained in:
Konstantin Kulikov
2019-11-14 05:48:26 +03:00
committed by Elias Naur
parent 1bf2c7ef29
commit 101b65f4e5
+3 -3
View File
@@ -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)