Binary Space Partitioning#77
Conversation
|
Hello! Thank you for giving it a shot! To be honest, this first implementation doesn't look that bad, though maybe instead of doing this iterative approach, we could just create the BSP tree on the fly when calculating the layout? Because the Calculating the tree should be pretty trivial since we only have at max 6-7 windows, so this shouldn't be too bad, plus, it would make:
Regardless, this first attempt looks very promising |
|
Sounds good! I'll try something out and put in more commits~ |
|
@nferhat So I made something new, still pretty naive but it builds the tree when we calculate layout. I based the implementation on how Basically, a node can only have zero or two children. A node with no children is a leaf and is set to display a tile, but when a new tile is added, the first node becomes a branch that basically "manages" the split for the next two leaf nodes. Then, we set the second child to potentially become a new leaf. From here, I can set it up to determine whether to use the first child or second as the splitting point to support other kinds of splitting (spiral, etc), but this version mostly does longest side fine. I'm still having an issue where the tiles are smaller than expected, but I think that's fixable too. |
|
Hey, this looks pretty nice, +the tests look fine. Going to test this locally and see! By the way if you could cherry-pick the docs typos into a separate PR I would be glad |
Seems like you are subtracting |
|
@nferhat Ah darn yeah, okay I got it working. I put all the inner gaps handling inside the BspTree because it gets kinda tricky with the numbers of tiles in the same plane. I'm probably going to work on the spiral/dwindle options now too, and maybe I'll try doing a focus-window-up/down/left/right as well, as per #44. Should it still be called BSP by the way? DWM and Hyprland refer to it as Dwindle, maybe have the module called "Tree" and then dwindle, spiral, etc. can be config options? |
Seems like you were too hasty and didn't wait for the image to upload. But seeing it locally, looks good! |
Yeah I thought it was just taking its time lol I'm working on the focus directions on a different branch, so if this is good to go, you can merge it if you like! But of course if you'd like to me to add the documentation first, I'll do so. |
|
When will this be finished |
Hi! I really like the compositor. I noticed there was an open issue for adding bspwm-like partitioning to the compositor, so I gave it a shot. I have a simple implementation working on my system running Arch. There's still a bunch I need to fix, such as how it interacts with inner gaps, as well as other edge cases I'm probably not taking into account. Please feel free to comment on this or reject it! I'd like to keep working on this if you'd have me.
Here is what it looks like on my system, just punched in a bunch of terminals:

I have this set in my
compositor.toml: