wayland: implement click-to-exit support using fullscreen capture surface#2272
Open
benny-e wants to merge 4 commits intodavatorium:nextfrom
Open
wayland: implement click-to-exit support using fullscreen capture surface#2272benny-e wants to merge 4 commits intodavatorium:nextfrom
benny-e wants to merge 4 commits intodavatorium:nextfrom
Conversation
Add state used by the Wayland backend to support click-to-exit behavior. When click-to-exit is enabled, the Wayland backend uses a fullscreen surface to receive pointer events outside the visible rofi menu. To support this, track both the fullscreen surface geometry and the visible menu rectangle so pointer handling and rendering code can distinguish between the two.
When click-to-exit is enabled on Wayland, use a fullscreen transparent surface so rofi can receive pointer events outside the visible menu. The menu itself keeps its normal size and theme-driven placement inside that surface. Rendering is translated to the menu rectangle so themes and placement options behave the same as in normal mode. When click-to-exit is disabled, the Wayland backend keeps the existing menu-sized surface behavior.
lbonn
reviewed
Mar 9, 2026
68a1d4d to
739d1a8
Compare
lbonn
reviewed
Mar 10, 2026
739d1a8 to
6f6aea8
Compare
Collaborator
|
@benny-e thanks a lot for working on this. I haven't been able to test it yet but will try to do so this week |
lbonn
reviewed
Mar 11, 2026
Collaborator
|
Apart from the outside-monitor parts being clipped, it is working as advertised :) |
00a2ccd to
026f3a3
Compare
lbonn
reviewed
Mar 12, 2026
Handle click-to-exit natively in the Wayland pointer path. When capture mode is enabled, pointer events are compared against the visible menu rectangle. Pointer presses outside that rectangle cancel the active view, while inside clicks continue through the normal widget event path. This allows click-to-exit to work on Wayland without compositor-side scripts or hacks. Fix doxygen and remove stray comment Seperated outside-click handling into its own function
026f3a3 to
cf8d37a
Compare
Author
|
removed the stray stdio.h include |
lbonn
reviewed
Mar 13, 2026
Collaborator
|
@benny-e thanks, I think it's close to a mergeable state. Do you mind if I squash all these changes in one commit with a meaningful message? |
Author
Great! I don't mind, feel free to squash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements native click-to-exit support for rofi's Wayland backend.
On Wayland, rofi cannot receive pointer events outside its surface, so
click-to-exit does not work when the surface only matches the visible
menu size. This patch addresses that by using a fullscreen transparent
surface when click-to-exit is enabled.
The visible menu keeps its normal size and theme-driven placement
inside that fullscreen surface. Pointer events are compared against the
visible menu rectangle so inside clicks continue through the normal
widget path, while outside clicks cancel the active view.
When click-to-exit is disabled, existing Wayland behavior remains
unchanged.
Fixes #2158
Tested with:
rofi -dmenu -no-config -no-click-to-exitrofi -dmenu -no-config -click-to-exitrofi -show drun -no-click-to-exitrofi -show drun -click-to-exitAlso tested with non-centered placement to verify that theme-driven
positioning is preserved in capture mode.
Tested on Hyprland and Sway with single and multi-monitor setups. Outside clicks close as expected, including clicking on another monitor.