Bugfix: Do not move the focus if a container is moved on a visible output
Patch status: merged
Patch by Sebastian Rachuj
To apply this patch, use:
curl http://cr.i3wm.org/patch/40/raw.patch | git am
b/src/con.c
14 |
@@ -762,24 +762,18 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool |
15 |
con_focus(old_focus); |
16 |
} |
17 |
|
18 |
- /* 8: when moving to a visible workspace on a different output, we keep the |
19 |
- * con focused. Otherwise, we leave the focus on the current workspace as we |
20 |
- * don’t want to focus invisible workspaces */ |
21 |
- if (source_output != dest_output && |
22 |
- workspace_is_visible(workspace) && |
23 |
- !con_is_internal(workspace)) { |
24 |
- DLOG("Moved to a different output, focusing target\n"); |
25 |
- } else { |
26 |
- /* Descend focus stack in case focus_next is a workspace which can |
27 |
- * occur if we move to the same workspace. Also show current workspace |
28 |
- * to ensure it is focused. */ |
29 |
- workspace_show(current_ws); |
30 |
- |
31 |
- /* Set focus only if con was on current workspace before moving. |
32 |
- * Otherwise we would give focus to some window on different workspace. */ |
33 |
- if (source_ws == current_ws) |
34 |
+ /* 8: when moving to another workspace, we leave the focus on the current |
35 |
+ * workspace. (see also #809) */ |
36 |
+ |
37 |
+ /* Descend focus stack in case focus_next is a workspace which can |
38 |
+ * occur if we move to the same workspace. Also show current workspace |
39 |
+ * to ensure it is focused. */ |
40 |
+ workspace_show(current_ws); |
41 |
+ |
42 |
+ /* Set focus only if con was on current workspace before moving. |
43 |
+ * Otherwise we would give focus to some window on different workspace. */ |
44 |
+ if (source_ws == current_ws) |
45 |
con_focus(con_descend_focused(focus_next)); |
46 |
- } |
47 |
|
48 |
/* If anything within the container is associated with a startup sequence, |
49 |
* delete it so child windows won't be created on the old workspace. */ |