From 87ed8df4fabc36bb4a5e30af4f638cc1febc4bdb Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Sat, 9 Dec 2017 15:35:05 +0200 Subject: [PATCH 1/3] floating_maybe_reassign_ws: show workspace before focusing With this change i3 will correctly switch to the focused workspace. This fixes bug with moving floating windows with 'move ' or by dragging like _NET_CURRENT_DESKTOP not getting updated or 'workspace back_and_forth' not working. Fixes #2921. --- src/floating.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/floating.c b/src/floating.c index 14988818..e2e9d85a 100644 --- a/src/floating.c +++ b/src/floating.c @@ -449,6 +449,7 @@ bool floating_maybe_reassign_ws(Con *con) { Con *ws = TAILQ_FIRST(&(content->focus_head)); DLOG("Moving con %p / %s to workspace %p / %s\n", con, con->name, ws, ws->name); con_move_to_workspace(con, ws, false, true, false); + workspace_show(ws); con_focus(con_descend_focused(con)); return true; } From 9ced77384bfa2b56b6d3c0d3ded01a7bfc2d8806 Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Sat, 9 Dec 2017 16:25:30 +0200 Subject: [PATCH 2/3] Remove useless check in _tree_next con_descend_focused on an empty workspace should return the workspace. --- src/tree.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tree.c b/src/tree.c index 710bb655..f87c4326 100644 --- a/src/tree.c +++ b/src/tree.c @@ -565,10 +565,8 @@ static bool _tree_next(Con *con, char way, orientation_t orientation, bool wrap) focus = con_descend_focused(workspace); } - if (focus) { - con_focus(focus); - x_set_warp_to(&(focus->rect)); - } + con_focus(focus); + x_set_warp_to(&(focus->rect)); return true; } From cf28147c5ecbd38db6524a0b1c20032ad9efe296 Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Sat, 9 Dec 2017 16:28:30 +0200 Subject: [PATCH 3/3] Show workspace in _tree_next Fixes a regression introduced by #2980. --- src/tree.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tree.c b/src/tree.c index f87c4326..d1c587d5 100644 --- a/src/tree.c +++ b/src/tree.c @@ -565,6 +565,7 @@ static bool _tree_next(Con *con, char way, orientation_t orientation, bool wrap) focus = con_descend_focused(workspace); } + workspace_show(workspace); con_focus(focus); x_set_warp_to(&(focus->rect)); return true;