i think this fixes i3 issues
[distro-setup] / i3-set-layout
index fc6866668a2480e7282046a9b12c318d8618b6ca..6e28c717fdb5444e10de445d6603f52daccfc150 100755 (executable)
@@ -29,6 +29,8 @@ def set_layout(i3):
     """
 
     win = i3.get_tree().find_focused()
+    # i don't use gp: todo: revert to original alternating_layout function
+    # which did not return gp.
     parent, gp = find_parent(i3, win.id)
 
 
@@ -46,7 +48,7 @@ def set_layout(i3):
     # instead of what we want. And in fact, the whole logic below is
     # incorrect and based on testing which did not realize that fact.
     #
-    if (parent and gp and len(parent.nodes) == 1):
+    if (parent and parent.type == 'con' and len(parent.nodes) == 1):
         # https://unix.stackexchange.com/questions/173754/how-to-move-a-window-up-to-the-level-of-its-parent-window-in-i3wm
         i3.command('mark i3ha')
         i3.command('focus parent')