wayland: implement click-to-exit support using fullscreen capture surface#2272
Merged
lbonn merged 1 commit intodavatorium:nextfrom Mar 20, 2026
Merged
wayland: implement click-to-exit support using fullscreen capture surface#2272lbonn merged 1 commit intodavatorium:nextfrom
lbonn merged 1 commit intodavatorium:nextfrom
Conversation
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
026f3a3 to
cf8d37a
Compare
Contributor
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? |
Contributor
Author
Great! I don't mind, feel free to squash |
0ee59af to
544ecc4
Compare
Click to exit is implemented using a fullscreen transparent surface to capture pointer events outside the visible menu. It has limitations with regard to multi-monitor setup but works well enough in the common case.
544ecc4 to
e58d1cf
Compare
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.