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

[New feature] resizing tiled windows (split ratio) #47

Merged
merged 17 commits into from
Jul 11, 2020

Conversation

takagiy
Copy link
Contributor

@takagiy takagiy commented Jul 6, 2020

This request is going to add some interfaces to make it possible to resize tiled windows with keys.
By this, the class Tree::Node will have new member variable ratio_ which represents how long the window is to its parent node and we will be able to resize the windows by modifying its ratio_.
Concretely, this request adds following four new actions.

  • resize_width <int>/resize_height <int>
    Resize the focused window by adding a given integer argument (percentage) to its ratio. To shrink windows, use negative values for the argument.
    These two actions can resize floating windows too, as the float_resize_* action does (so they could be replacements of them). In that case, it regards the float_resize_step value in config but not the absolute value of the given argument.

  • resize_set_ratio <int>
    Resize the focused window to the ratio specified by a given integer argument (%) and distribute the remaining space to its sibling windows evenly. This action is intended to be used to apply preferred layouts quickly.

  • resize_reset_ratios
    Resize the focused window and its sibling windows so that they will share their parent's space evenly.

This request also adds some example configurations using these new actions.
Please feel free to let me know if you have any questions.

Thank you!

@aesophor
Copy link
Owner

aesophor commented Jul 8, 2020

Thank you so much for this amazing patch... Everything is implemented so perfectly 😸 😸 😸

I only spotted one (possible) glitch. Here's the steps to reproduce:

  1. spawn two windows (horizontally)
  2. press $Mod+$Alt+0
    (Now these two windows will overlap with each other)

I think perhaps we can remove bindsym $Mod+$Alt+0 resize_set_ratio 100 if it doesn't have special purposes?

Thank you again for your hard work! Love this so much...

src/tree.cc Outdated Show resolved Hide resolved
example/config Outdated Show resolved Hide resolved
@aesophor aesophor merged commit f797da6 into aesophor:master Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants