lbonn / rofi

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

Add support for click-to-exit on wayland #95

Closed Nemo157 closed 3 months ago

Nemo157 commented 8 months ago

At least on Hyprland this works, having an overlay appears to capture all mouse events even outside the rendered view and reports any outside as coordinate 0,0. (This does mean clicking exactly on 0,0 would also exit, but that seems an acceptably small target to me :upside_down_face:).

fixes #22

Nemo157 commented 8 months ago

One thing I need to change, this results in a success return value.

lbonn commented 8 months ago

Nice! Unfortunately it's not working on sway 1.8.1. I'll try to have a look at how Hyprland handles this internally and see if this kind of "feature" has been requested on sway as well.

lbonn commented 6 months ago

@Nemo157 I don't consistently get (0,0) when clicking outside of the menu on hyprland either. A bit strange... Sometimes it works at the first click, otherwise a few clicks later.

Nemo157 commented 6 months ago

Interesting, I don't use it that often as I mostly use the keyboard, but I haven't noticed any times it's failed. I guess I should go spelunking in hyprland to see if I can figure out exactly how it's meant to behave.

earboxer commented 6 months ago

At least on Hyprland this works, having an overlay appears to capture all mouse events even outside the rendered view and reports any outside as coordinate 0,0.

This is a bug in Hyprland (https://github.com/hyprwm/Hyprland/issues/2017) which I have a fix for at https://github.com/hyprwm/Hyprland/pull/4401

Nemo157 commented 6 months ago

Ah, I see. Is there any correct way to get exclusive mouse focus too then? (I guess maybe rendering as the full resolution with a transparent background covering the rest of the screen).

loki1368 commented 3 months ago

Hello! Please merge this PR. I'am waiting for it for several months.

wjoel commented 3 months ago

Until something like this gets merged you can use -kb-cancel Escape,MouseMiddle to close rofi by clicking the middle mouse button (for example) anywhere on rofi's window. Works well enough for me, anyway.

Nemo157 commented 3 months ago

I should probably close this now since the approach is wrong (though I'm still personally using this as I haven't updated to a version of Hyprland where it's broken yet :grin:). I took a brief look at doing a transparent fullscreen overlay, but it didn't seem easy to fit into how the rendering is structured, and it may have other side-effects when combined with compositor features like blur.