~eliasnaur/gio-patches

app/internal/window: map window after defining WM protocols v2 PROPOSED

Konstantin Kulikov: 1
 app/internal/window: map window after defining WM protocols

 1 files changed, 3 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/9044/mbox | git am -3
Learn more about email & git

[PATCH v2] app/internal/window: map window after defining WM protocols Export this patch

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>
---
 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 7f69b36..d4d6987 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)
-- 
2.23.0
Thanks, applied:

To git.sr.ht:~eliasnaur/gio
   1bf2c7e..101b65f  master -> master
View this thread in the archives