]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Don’t unmap windows when current workspace gets reassigned
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 24 Mar 2010 15:06:21 +0000 (16:06 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 24 Mar 2010 15:06:21 +0000 (16:06 +0100)
Steps to reproduce were:
1) xrandr --output VGA1 --auto --left-of LVDS1
2) open a terminal on VGA1
3) xrandr --output VGA1 --off

src/workspace.c

index 67874f2910f139a1641256c058311db57d5ffae5..3fe4751b80a655fdf2401611315dd632c7ef6b99 100644 (file)
@@ -248,12 +248,17 @@ void workspace_assign_to(Workspace *ws, Output *output, bool hide_it) {
         if (visible && !hide_it)
                 return;
 
-        workspace_unmap_clients(global_conn, ws);
-
+        /* however, if this is the current workspace, we only need to adjust
+         * the output’s current_workspace pointer (and must not unmap the
+         * windows) */
         if (c_ws == ws) {
                 DLOG("Need to adjust output->current_workspace...\n");
                 output->current_workspace = c_ws;
+                ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"focus\"}");
+                return;
         }
+
+        workspace_unmap_clients(global_conn, ws);
 }
 
 /*