i3 - improved tiling WM


Consistently set focus across outputs

Patch status: rejected

Patch by Tony Crisci

Long description:

When focusing across containers, the window on the top of the focus
stack should get focus, even when that container is on another output.

fixes #1160

To apply this patch, use:
curl http://cr.i3wm.org/patch/596/raw.patch | git am

b/src/tree.c

18
@@ -581,7 +581,7 @@ static bool _tree_next(Con *con, char way, orientation_t orientation, bool wrap)
19
         if (con_get_fullscreen_con(workspace, CF_OUTPUT))
20
             return true;
21
 
22
-        Con *focus = con_descend_direction(workspace, direction);
23
+        Con *focus = con_descend_tiling_focused(workspace);
24
         if (focus) {
25
             con_focus(focus);
26
             x_set_warp_to(&(focus->rect));

b/testcases/t/510-focus-across-outputs.t

31
@@ -99,7 +99,8 @@ reset_focus $s3_ws;
32
 
33
 cmd "workspace $s2_ws";
34
 cmd 'focus right';
35
-is($x->input_focus, $sixth->id, 'sixth window focused');
36
+diag 'it should focus the window on the top of the focus stack';
37
+is($x->input_focus, $seventh->id, 'seventh window focused');
38
 reset_focus $s3_ws;
39
 
40
 cmd "workspace $s2_ws";
41
@@ -128,7 +129,8 @@ reset_focus $s3_ws;
42
 
43
 cmd "workspace $s1_ws";
44
 cmd 'focus left';
45
-is($x->input_focus, $second->id, 'second window focused');
46
+diag 'it should focus the window on the top of the focus stack';
47
+is($x->input_focus, $first->id, 'first window focused');
48
 reset_focus $s0_ws;
49
 
50
 cmd "workspace $s1_ws";
51
@@ -142,7 +144,8 @@ is($x->input_focus, $sixth->id, 'sixth window focused');
52
 
53
 cmd "workspace $s2_ws";
54
 cmd 'focus up';
55
-is($x->input_focus, $second->id, 'second window focused');
56
+diag 'it should focus the window on the top of the focus stack';
57
+is($x->input_focus, $first->id, 'first window focused');
58
 
59
 exit_gracefully($pid);
60