i3 - improved tiling WM


Fix keyboard resize in windows beneath stacked/tabbed containers

Patch status: superseded

Patch by jj

Long description:

When resizing with keyboard, stacked and tabbed containers need to be
skipped.

fixes #1085

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

b/src/commands.c

18
@@ -618,19 +618,19 @@ static void cmd_resize_floating(I3_CMD, char *way, char *direction, Con *floatin
19
 
20
 static bool cmd_resize_tiling_direction(I3_CMD, Con *current, char *way, char *direction, int ppt) {
21
     LOG("tiling resize\n");
22
-    /* get the appropriate current container (skip stacked/tabbed cons) */
23
     Con *other = NULL;
24
     double percentage = 0;
25
-    while (current->parent->layout == L_STACKED ||
26
-           current->parent->layout == L_TABBED)
27
-        current = current->parent;
28
 
29
-    /* Then further go up until we find one with the matching orientation. */
30
+    /* Go up in the tree and search for a container to resize */
31
     orientation_t search_orientation =
32
         (strcmp(direction, "left") == 0 || strcmp(direction, "right") == 0 ? HORIZ : VERT);
33
 
34
     do {
35
-        if (con_orientation(current->parent) != search_orientation) {
36
+        /* get the appropriate current container with the matching
37
+         * orientation (skip stacked/tabbed cons) */
38
+        if ((con_orientation(current->parent) != search_orientation) ||
39
+            (current->parent->layout == L_STACKED) ||
40
+            (current->parent->layout == L_TABBED)) {
41
             current = current->parent;
42
             continue;
43
         }
44
@@ -668,7 +668,7 @@ static bool cmd_resize_tiling_direction(I3_CMD, Con *current, char *way, char *d
45
              current->type != CT_FLOATING_CON);
46
 
47
     if (other == NULL) {
48
-        LOG("No other container in this direction found, trying to look further up in the tree...\n");
49
+        LOG("No other container in this direction found.\n");
50
         ysuccess(false);
51
         return false;
52
     }