davatorium / rofi

Rofi: A window switcher, application launcher and dmenu replacement
https://davatorium.github.io/rofi/
Other
13.04k stars 609 forks source link

[BUG] "Width" setting breaks nested rofi instances in bash scripts when using the mouse. #1528

Open griffinevans opened 2 years ago

griffinevans commented 2 years ago

Rofi version (rofi -v)

1.7.0

Configuration

https://gist.github.com/griffinevans/23f1cbf7590d66ae329c6518943e94ea

Launch command

./examplescript or i3 keyboard shortcut with exec

Step to reproduce

How to reproduce with the above config files:

  1. Execute the script to view the first rofi bar.
  2. Select 1 by double-clicking with the mouse, not by pressing enter.

Expected behavior

I would expect the second rofi menu to launch with a width of 100 and otherwise-default settings.

Actual behavior

The second rofi menu terminates immediately; its output is null; sometimes the second rofi menu flashes across the screen for a fraction of a second before disappearing, which is why I believe it is launching and then terminating immediately as opposed to not launching at all.

Additional information

This bug happens when a bash script executes a rofi instance from the output of a rofi instance, like in the case statement above. When the nested rofi instance is executed, if its theme (example.rasi) has a "width: " parameter AND the rofi instance was launched by mouse click, not keyboard press, the second rofi instance will launch and then immediately terminate.

If I change nothing else except deleting the width parameter, the second rofi instance launches fine. I have tested this with less minimal configurations with many more parameters, but "width" was the only one I observed causing issues.

DaveDavenport commented 2 years ago

nested rofi are not supported.

I wonder if the mouse release get caught by the 2nd rofi and it interpreters it to be a click outside the window (and therefor closes)

Can you try to pass '-no-click-to-exit' to the 2nd rofi.

griffinevans commented 2 years ago

Passing '-no-click-to-exit' on the second call fixes it. Thank you! I can't believe you spotted that so quick after I spent 3 hours trying to figure it out! And as for nested rofi not being supported, I guess I should learn my lesson about copying random people's code from the internet...

DaveDavenport commented 2 years ago

I don't think you are not nesting rofi, so that is no problem. Just wanted to highlight it as it is called this in title..

I think I should take a peek if we can fix this ssue.

joaopauloalbq commented 1 year ago

Additional information

Rofi won't close if the mouse is over it.

https://user-images.githubusercontent.com/9905202/202858872-cc844115-cbc4-4782-96ee-7444ed199593.mp4

DaveDavenport commented 1 year ago

That matches exactly with my first remark on Nov 15, 2021.