Shizcow / dmenu-rs

A pixel perfect port of dmenu, rewritten in Rust with extensive plugin support
GNU General Public License v3.0
202 stars 9 forks source link

Vertical rendering doesn't work #38

Closed onkruid closed 3 years ago

onkruid commented 3 years ago

Rendering items vertically seems broken. dmenu_path | dmenu -l 10 only shows a single suggestion, even when there are more.

The issue seems to located here: https://github.com/Shizcow/dmenu-rs/blob/aeadc2b644c06c9b4b351a7687bcd1f03d40e616/src/dmenu/item.rs#L209 It looks like we increment coord with the width instead of the height.

Replacing that line with the following fixes it:

matched_partitions[partition][index].draw(0, coord, drw.w, drw)?;
coord += drw.pseudo_globals.bh as i32;

I'm not familiar enough with the code to know if that is the best way to fix it!

Thanks!

Shizcow commented 3 years ago

Yup, that totally looks like it. Even though I never use -l I'm surprised this bug hasn't been noticed yet. Your fix looks correct and I'll run some additional tests to make sure everything's working before pushing a patch soon. Thanks for bringing this to my attention.