From 0227d01c4387894a26344a1faa8143e01902b181 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Tue, 23 Dec 2025 23:38:51 +0900 Subject: [PATCH] better --- milkwm/xserver.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/milkwm/xserver.c b/milkwm/xserver.c index e7c39d8..86edf99 100644 --- a/milkwm/xserver.c +++ b/milkwm/xserver.c @@ -470,7 +470,6 @@ void loop_x(void) { if(ret) continue; if(i != arrlen(windows)) { XWindowAttributes xwa; - XConfigureEvent ev2; if(!XGetWindowAttributes(xdisplay, windows[i].client, &xwa)) { wm_destroy(windows[i].frame); arrdel(windows, i); @@ -490,16 +489,6 @@ void loop_x(void) { arrdel(windows, i); continue; } - - ev2.type = ConfigureNotify; - ev2.display = xdisplay; - ev2.event = windows[i].client; - ev2.x = xwa.x + wm_content_x(); - ev2.y = xwa.y + wm_content_y(); - ev2.width = xwa.width; - ev2.height = xwa.height; - XSendEvent(xdisplay, windows[i].client, False, StructureNotifyMask, (XEvent*)&ev2); - XUngrabServer(xdisplay); XMapWindow(xdisplay, windows[i].client); set_focus(windows[i].client); @@ -554,6 +543,16 @@ void loop_x(void) { w.working = 1; save(w.client); arrput(windows, w); + + XConfigureEvent ev2; + ev2.type = ConfigureNotify; + ev2.display = xdisplay; + ev2.event = w.client; + ev2.x = xwa.x + wm_content_x(); + ev2.y = xwa.y + wm_content_y(); + ev2.width = xwa.width; + ev2.height = xwa.height; + XSendEvent(xdisplay, w.client, False, StructureNotifyMask, (XEvent*)&ev2); } } else if(ev.type == UnmapNotify) { int i;