bspwm icon indicating copy to clipboard operation
bspwm copied to clipboard

Resize windows according to WM_NORMAL_HINTS

Open 010penetrator opened this issue 2 years ago • 4 comments

Would be nice to obey "program specified resize increment: X by X" from WM_NORMAL_HINTS. I need it for terminal windows with apps which set their own background color like Vim. Unless the window size is product of char size I get stripes of the terminal's background like discussed there - https://www.reddit.com/r/neovim/comments/tomcpl/black_lines_between_neovim_and_kitty_terminal/ The terminal program like Kitty actually provides the hint about its char size via xprops.

010penetrator avatar Mar 27 '22 14:03 010penetrator

#111 was a related issue

010penetrator avatar Mar 27 '22 14:03 010penetrator

check honor_size_hints config

ortango avatar Mar 27 '22 18:03 ortango

check honor_size_hints config

Thanks! That almost works. Problem now is that I can't grow window with increment lesser than hint suggests. While shrinking works as I do like, i.e. if step required by control command is too small, it would shrink by size of one cell. As a result, I can shrink but cant grow with hotkeys. I believe growing logic should be corrected.

010penetrator avatar Mar 27 '22 22:03 010penetrator

Problem now is that I can't grow window with increment lesser than hint suggests.

i had forgotten all about that. it's really unfortunate.

I believe growing logic should be corrected.

seems like no small hack because of how apply_size_hints gets run (you could shoehorn something into messages.c as a special case though -- horrible POC of that here.)

maybe the simplest fix would be a script to check for honor_size_hints and check/grab the size increment like read _ w h < <(xprop -id "$THEWINDOW" -f WM_NORMAL_HINTS 32mii ' $9 $10' WM_NORMAL_HINTS) for the --resize. that might be too horrible though.


late addition: i think this might be a nice balance between horrible hack and functional fix

ortango avatar Mar 27 '22 23:03 ortango