summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sxwm.c8
1 files changed, 5 insertions, 3 deletions
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);