From 31e322b52f88e0f803ed4ac4d21c44662d68b3ea Mon Sep 17 00:00:00 2001 From: uint23 Date: Tue, 29 Apr 2025 18:02:11 +0100 Subject: fix window unmapping issue when changing workspace --- src/sxwm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/sxwm.c') diff --git a/src/sxwm.c b/src/sxwm.c index ecde1c1..1e2ab6e 100644 --- a/src/sxwm.c +++ b/src/sxwm.c @@ -1413,21 +1413,23 @@ void change_workspace(int ws) if (ws >= NUM_WORKSPACES || ws == current_ws) { return; } + + for (Client *c = workspaces[current_ws]; c; c = c->next) { + XUnmapWindow(dpy, c->win); + } + current_ws = ws; - /* map new desktop */ for (Client *c = workspaces[current_ws]; c; c = c->next) { XMapWindow(dpy, c->win); } - /* retile & refocus */ tile(); if (workspaces[current_ws]) { focused = workspaces[current_ws]; XSetInputFocus(dpy, focused->win, RevertToPointerRoot, CurrentTime); } - /* update atom */ long cd = current_ws; XChangeProperty(dpy, root, XInternAtom(dpy, "_NET_CURRENT_DESKTOP", False), XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&cd, 1); -- cgit v1.2.3