baskerville / bspwm

A tiling window manager based on binary space partitioning
BSD 2-Clause "Simplified" License
7.8k stars 415 forks source link

Take into account vacant nodes when adjusting ratios #1431

Closed emanuele6 closed 1 year ago

emanuele6 commented 1 year ago

Before this patch, resizing A vertically right after hiding B in the following layout, would squish C.

+---+---+      +---+---+      +----+--+
|   | B |      |   |   |      |    |C |
|   +---+      |   | C |      |    +--+
|   | C |      |   |   |      |    |  |
| A +---+  =>  | A +---+  =>  | A  |  |
|   |   |      |   |   |      |    |D |
|   | D |      |   | D |      |    |  |
|   |   |      |   |   |      |    |  |
+---+---+      +---+---+      +----+--+
emanuele6 commented 1 year ago

Drafting, I can no longer reproduce the bug.

emanuele6 commented 1 year ago

The bug can only be reproduced with those steps if the tree is:

  1
 / \
A   2
   / \
  B   3
     / \
    C   D

Not if it is:

  1
 / \
A   2
   / \
  3   D
 / \
B   C

I was reproducing the bug with the second tree state after applying my previous patch, so I thought it fixed the issue when it actually accomplished nothing.

The new patch actually fixes the bug.

emanuele6 commented 1 year ago

https://user-images.githubusercontent.com/20175435/216782704-bce997ec-cb45-4c21-bbb5-50559e509bf7.mp4

emanuele6 commented 1 year ago

The bug can also be reproduced if B's state is changed to floating. Any vacant node should be skipped, not just hidden nodes.