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] Maintain aspect ratio of floating windows when resizing #1217

Closed
borosai opened this issue Oct 29, 2020 · 5 comments
Closed

Comments

@borosai
Copy link

borosai commented Oct 29, 2020

I feel the current behavior is the correct default behavior: resize floating windows freely. However, in certain situations it would be nice to be able to resize a floating window while maintaining its aspect ratio (in my case, video content).

Without getting into the implementation (which I don't understand anyway), something like this would be ideal (only mouse related):
super + button3 -> resize freely (current behavior)
super + shift + button3 -> resize while maintaining aspect ratio

Honestly, this would be a nice enhancement to see, but it's not important since I currently just resize carefully to eliminate the black bars. Still, if it's not too much of a pain to implement, it would be great.

@alex3kov
Copy link

Would be nice - for example i3 resizes mpv proportionally by default (no idea how).

@ortango
Copy link

ortango commented Jan 23, 2021

if you have honor_size_hints on then windows should resize based on their hints. mpv for instance would act as described. above.

otherwise you can use wmutils to mimic the behavior; either by a keybind that resizes based on current size and a multiplier(+1/10,*2,etc).
or by subscribing to pointer_action and watching for, say, resize_corner, capturing the size at begin and resizing one dimension to match the original ratio at end.

@alex3kov
Copy link

honor_size_hints works for mpv (it's bspc config honor_size_hints true in config)

@borosai
Copy link
Author

borosai commented Jan 24, 2021

@ortango
Thanks for the tips. honor_size_hints is something I always disable because I prefer my windows to be tiled evenly, so I hadn't considered this setting as a way to deal with resizing these specific windows.

I'll focus on the methods you've mentioned, and I suppose it's fine to close this issue.

@borosai borosai closed this as completed Jan 24, 2021
@ortango
Copy link

ortango commented Feb 11, 2021

i don't know if you happened to see this PR come in, but it seems like exactly what you would like: #1251

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

No branches or pull requests

3 participants