Shizcow / dmenu-rs

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

dmenu not displayed on some empty monitors #9

Closed 0x85C closed 4 years ago

0x85C commented 4 years ago

In a multi-monitor setup (I'm using 3), if the active monitor has no open windows, the dmenu appears to always launch to the first monitor, rather than the current active monitor, I have to open at least 1 window, i.e. terminal, to get the dmenu to show up on the same monitor. dmenu does not have this issue. I am using i3wm. Thanks.

Shizcow commented 4 years ago

I am able to replicate this issue. However, community/dmenu also has this issue for me, but only sometimes.

I'm unsure how difficult this will be to fix, but I'll look into it.

Shizcow commented 4 years ago

This issue has been resolved. It was causes by the following bit of code:

for i in 0..n {
    if intersect(x, y, 1, 1, info.offset(i as isize)) != 0 {
    break;
    }
}

i is a local variable that's intended to be overwritten. The loop invokes shadowing rules, leaving local i untouched. Targeting for 5.2.3 release.