"""
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)
# 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')