Only re-focus the workspace when moving a con if the target ws is hidden.
This commit is contained in:
parent
e89a25f81f
commit
a9d859f84e
11
src/con.c
11
src/con.c
@ -714,12 +714,15 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool
|
|||||||
* we don’t focus when there is a fullscreen con on that workspace. */
|
* we don’t focus when there is a fullscreen con on that workspace. */
|
||||||
if (!con_is_internal(workspace) &&
|
if (!con_is_internal(workspace) &&
|
||||||
con_get_fullscreen_con(workspace, CF_OUTPUT) == NULL) {
|
con_get_fullscreen_con(workspace, CF_OUTPUT) == NULL) {
|
||||||
/* We need to save focus on workspace level and restore it afterwards.
|
/* We need to save the focused workspace on the output in case the
|
||||||
* Otherwise, we might focus a different workspace without actually
|
* new workspace is hidden and it's necessary to immediately switch
|
||||||
* switching workspaces. */
|
* back to the originally-focused workspace. */
|
||||||
Con *old_focus = TAILQ_FIRST(&(output_get_content(dest_output)->focus_head));
|
Con *old_focus = TAILQ_FIRST(&(output_get_content(dest_output)->focus_head));
|
||||||
con_focus(con_descend_focused(con));
|
con_focus(con_descend_focused(con));
|
||||||
con_focus(old_focus);
|
|
||||||
|
/* Restore focus if the output's focused workspace has changed. */
|
||||||
|
if (con_get_workspace(focused) != old_focus)
|
||||||
|
con_focus(old_focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 8: when moving to a visible workspace on a different output, we keep the
|
/* 8: when moving to a visible workspace on a different output, we keep the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user