From 037b1c371097d4fae545f26c5c55365b8cdefdd8 Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Fri, 23 Mar 2018 12:56:30 +0200 Subject: [PATCH 1/3] _con_move_to_con: showing target_ws is useless The current_ws is shown latter anyway: if (!ignore_focus) { workspace_show(current_ws); ... This also causes the following bug: - Open a window in an empty workspace - Switch to another workspace - seturgent to the first window - Move another window to the first workspace - Urgent flag is now reset --- src/con.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/con.c b/src/con.c index 985d07da..25bea8e5 100644 --- a/src/con.c +++ b/src/con.c @@ -1170,20 +1170,6 @@ static bool _con_move_to_con(Con *con, Con *target, bool behind_focused, bool fi floating_fix_coordinates(con, &(source_output->rect), &(dest_output->rect)); } else DLOG("Not fixing coordinates, fix_coordinates flag = %d\n", fix_coordinates); - - /* If moving to a visible workspace, call show so it can be considered - * focused. Must do before attaching because workspace_show checks to see - * if focused container is in its area. */ - if (!ignore_focus && workspace_is_visible(target_ws)) { - workspace_show(target_ws); - - /* Don’t warp if told so (when dragging floating windows with the - * mouse for example) */ - if (dont_warp) - x_set_warp_to(NULL); - else - x_set_warp_to(&(con->rect)); - } } /* If moving a fullscreen container and the destination already has a From 9a1fcff4e0e4a1b2bd825c25a9fc468b0a1841d8 Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Fri, 23 Mar 2018 13:00:36 +0200 Subject: [PATCH 2/3] _con_move_to_con: remove outdated comment --- src/con.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/con.c b/src/con.c index 25bea8e5..669ff5d3 100644 --- a/src/con.c +++ b/src/con.c @@ -1213,10 +1213,6 @@ static bool _con_move_to_con(Con *con, Con *target, bool behind_focused, bool fi /* 7: when moving to another workspace, we leave the focus on the current * workspace. (see also #809) */ - - /* Descend focus stack in case focus_next is a workspace which can - * occur if we move to the same workspace. Also show current workspace - * to ensure it is focused. */ if (!ignore_focus) { workspace_show(current_ws); if (dont_warp) { From 9e3b48dd22b469875eefaa4a3c6792ac6ccf4e61 Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Fri, 23 Mar 2018 13:27:05 +0200 Subject: [PATCH 3/3] con_activate -> con_focus when it is used as a building block --- src/con.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/con.c b/src/con.c index 669ff5d3..480b9e9e 100644 --- a/src/con.c +++ b/src/con.c @@ -1208,7 +1208,7 @@ static bool _con_move_to_con(Con *con, Con *target, bool behind_focused, bool fi /* Restore focus if the output's focused workspace has changed. */ if (con_get_workspace(focused) != old_focus) - con_activate(old_focus); + con_focus(old_focus); } /* 7: when moving to another workspace, we leave the focus on the current