New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree_flatten incorrectly closes vertical container inside stacked #3003

Open
orestisf1993 opened this Issue Sep 30, 2017 · 1 comment

Comments

Projects
None yet
4 participants
@orestisf1993
Member

orestisf1993 commented Sep 30, 2017

Output of i3 --moreversion 2>&- || i3 --version:

Binary i3 version:  4.14-128-gc08ef361 (2017-09-29, branch "next") © 2009 Michael Stapelberg and contributors

URL to a logfile as per https://i3wm.org/docs/debugging.html:

https://logs.i3wm.org/logs/5702096292675584.bz2

What I did:

This bug is similar to #1053:

  1. fresh workspace
  2. open window
  3. layout stacked
  4. open window
  5. split h
  6. open window
  7. split v
  8. open window
  9. focus left
  10. move left

What I saw:

The right side now has 3 stacked containers
2017-09-30-043403_1680x1009

What I expected instead:
H[window S[window V[window window]]]

I think part of the problem is the use of con_orientation instead of ->layout:

i3/src/tree.c

Lines 718 to 719 in 7a7481e

con_orientation(con) == con_orientation(child) ||
con_orientation(child) != con_orientation(parent))

@efenwick97

This comment has been minimized.

Show comment
Hide comment
@efenwick97

efenwick97 Apr 10, 2018

I took a look at this issue and I think it stems from tree_flatten in src/tree.c always flattening a pair of containers. In the example posted above, in order for the desired behavior to occur, only a single container should be flattened. I'm about to open a PR that addresses this. My solution is to flatten only the current container if the layout of the child and the parent are different. If they have the same layout then both the current container and its child will be flattened.

efenwick97 commented Apr 10, 2018

I took a look at this issue and I think it stems from tree_flatten in src/tree.c always flattening a pair of containers. In the example posted above, in order for the desired behavior to occur, only a single container should be flattened. I'm about to open a PR that addresses this. My solution is to flatten only the current container if the layout of the child and the parent are different. If they have the same layout then both the current container and its child will be flattened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment