lbonn / rofi

Rofi: A window switcher, run dialog and dmenu replacement - fork with wayland support
Other
927 stars 36 forks source link

[BUG] Window resizing glitch with height in percentage #49

Closed elder-n00b closed 2 years ago

elder-n00b commented 2 years ago

Rofi version (rofi -v)

1.7.3+wayland1-1-g9efa6504

Configuration

(none, no config)

Launch command

rofi -no-config -show-icons -show drun -theme-str 'window { height: 80%;}'

Step to reproduce

rofi -no-config -show-icons -show drun -theme-str 'window { height: 80%;}'

Expected behavior

Window height 80% of screen height, no glitches.

Actual behavior

The 80% window flashes together with the blinking cursor (visually) behind the default height one, and when I type something, every key press results in the rofi window shrinking vertically some more (by the percent amount?), leaving previous "images" of it on screen. This only happens when both show-icons is true and height is in percents but not 100% (that works).

Additional information

https://github.com/davatorium/rofi/discussions/1587

I am running on Arch derived distro with Sway. wayland 1.20.0-1 sway 1:1.7-1

I built rofi from sources, updating the rofi-lbonn-wayland AUR PKGBUILD to 1.7.3+wayland1 which according to git describe --long is 1.7.3+wayland1-1-g9efa6504. Behavior was the same with 1.7.1. I tried with xcb enabled and disabled -- not that it should make any difference on wayland, but just in case.

Workaround without using percents is easy, I just thought I'd report the weirdness.

Not sure if I can provide a PR, probably not.

lbonn commented 2 years ago

Can confirm, indeed very weird :smiley:

lbonn commented 2 years ago

Basically this function is wrong https://github.com/lbonn/rofi/blob/9efa6504c3b6a9b39d8d423a7fd7f3783e865c03/source/wayland/view.c#L91.

I took a shortcut when writing it, so every time the height is updated, it's set to 80% the previous height.

lbonn commented 2 years ago

I've pushed a quick fix on master https://github.com/lbonn/rofi/commit/396b13f5a83bfc4c54a8fccdcf3fb4ab4e2cfd0c.

It's not great but it should fix this particular issue.

Could you please verify?

elder-n00b commented 2 years ago

of course, sorry for delay I built the wrong one

elder-n00b commented 2 years ago

And yes this fixes it! :+1:

lbonn commented 2 years ago

Thanks!