Merge pull request #4604 from orestisfl/fix-focus-warp

Fix focus issue when moving windows across outputs
This commit is contained in:
Ingo Bürk 2021-11-05 15:32:07 +01:00 committed by GitHub
commit 20d0591e77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1 @@
fix focus when moving container between outputs with mouse warp and focus_follows_mouse

View File

@ -228,10 +228,19 @@ static void move_to_output_directed(Con *con, direction_t direction) {
* the focused container, con, is now a child of ws. To work around this * the focused container, con, is now a child of ws. To work around this
* and still produce the correct workspace focus events (see * and still produce the correct workspace focus events (see
* 517-regress-move-direction-ipc.t) we need to temporarily set focused * 517-regress-move-direction-ipc.t) we need to temporarily set focused
* to the old workspace. */ * to the old workspace.
*
* The following happen:
* 1. Focus con to push it on the top of the focus stack in its new
* workspace
* 2. Set focused to the old workspace to force workspace_show to
* execute
* 3. workspace_show will descend focus and target our con for
* focusing. This also ensures that the mouse warps correctly.
* See: #3518. */
con_focus(con);
focused = old_ws; focused = old_ws;
workspace_show(ws); workspace_show(ws);
con_focus(con);
} }
/* force re-painting the indicators */ /* force re-painting the indicators */