lbonn / rofi

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

[BUG] -click-to-exit not working #22

Open ram02z opened 3 years ago

ram02z commented 3 years ago

Version

Output of rofi -v 1.6.1-wayland

Configuration

Output of rofi -help (in a gist, please paste the full output) https://gist.github.com/ram02z/07c7888924bbe35068d7c3883b308c55

Launch Command

The commandline used to launch **rofi** rofi -show

Steps to reproduce

What behaviour you see

Nothing happens. Excuse my ignorance, but is this expected due to how wayland works?

What behaviour you expect to see

The rofi window closes.

Additional details: The issue persists with the default config.

Please do not submit reports related to wayland, see here for more information.

lbonn commented 3 years ago

Indeed, that's difficult to implement as is, as pointer events outside of the target surface are not sent by design in wayland.

It could maybe work if we'd reserve a layer covering the complete screen but only show the rofi window in a limited area. This way, we'd get mouse events anywhere. But that sounds a bit hacky and may be tricky with multi-monitors...

Another trick (maybe) would be to add an option to exit on pointer leave (in wl_pointer_listener) and have your compositor focus on click. Also weird

Otherwise, I think it would need some additional supports in protocols or compositor-specific.

I'll leave the bug open in case somebody has a great idea for this.

ghost commented 2 years ago

Another idea (deviates a bit from standard rofi): optionally make the #window clickable, use the mainbox for actual content (that's how I do it to get a nice fullscreen overlay behind the actual "menu")

window:
  background-color: "#YONICE"
  children: "[mainbox]"
  fullscreen: true
  padding: 0 80% 0 0      # <------ use this for positioning instead of rofi's anchors 

mainbox:
  background-color: "#D000D3"
  children: "[this, and, that]"
  expand: true

[...]
Visne commented 1 year ago

Wouldn't the best way to do this be to steal the focus and then automatically close rofi when focus is lost (I assume Wayland apps can know that they lost focus)?

Nemo157 commented 10 months ago

At least on hyprland it looks like rofi is getting the mouse events always, I guess because it's the only app on the overlay layer.