Skip to content
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

Feature request: Allow for bspwm-style window tiling based on currently focused window #59

Open
da-rth opened this issue Oct 29, 2021 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@da-rth
Copy link

da-rth commented Oct 29, 2021

Currently, komorebi applies a 'right-most window' tiling method for its bsp layout when a new window is moved to/opened on a workspace. This means that there is currently no way to have nested window layouts on the top/bottom left and top right of the areas of the screen.

I would like to request that komorebi may implement the bspwm-style window tiling method which splits based on the location of the currently focused window. Please see the attached video of an example of the requested behaviour implemented in swaywm:

ScreenCapture_2021-10-29-092848.mp4

Note:

  • 00:00 to 00:06 illustrates how all tiling is handled in komorebi via the right-most window method.
  • 00:07 on-wards illustrates tiling windows based on the currently focused window
@da-rth da-rth changed the title Feature request: Allow for BSPWM Style window splitting based on currently focused window Feature request: Allow for bspwm-style window tiling based on currently focused window Oct 29, 2021
@LGUG2Z LGUG2Z added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Oct 29, 2021
@LGUG2Z
Copy link
Owner

LGUG2Z commented Oct 29, 2021

The big prerequisite for this kind of feature is being able to seamlessly translate between Vec-like and Tree-like data structures for container state.

Right now, komorebi uses a Ring data structure, which is a wrapper around a VecDeque which also tracks a focused index (it is the responsibility of the mutator to ensure that this index is updated).

Ideally we would have a tree data structure that can be created from and can create a Ring (implementing From), then we would be able to re-use (or translate) a lot of the existing layout generation logic from other window managers that allow any node to be considered the root of a tree (as shown in the SwayWM video).

I'm pretty far removed from my last DS&A class and I (luckily) have never had to grind Leetcode so I'm pretty out of practice here when it comes to implementing a binary space partition tree from scratch (especially one that plays nice with Rust's borrow checker), but I am happy to review any contributions to add a true BSP data structure to komorebi to enable this and other features in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants