From 0f7ac09c7b0e5c03ac6c90cc589abc7b8bbb2577 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 24 Mar 2010 16:06:21 +0100 Subject: [PATCH] =?utf8?q?Bugfix:=20Don=E2=80=99t=20unmap=20windows=20when?= =?utf8?q?=20current=20workspace=20gets=20reassigned?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/workspace.c b/src/workspace.c index 67874f29..3fe4751b 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -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); } /* -- 2.39.5