Repository navigation
Dismiss the menu when clicking on another monitor - #77
Closed
EttienneCanva wants to merge 1 commit into
Closed
EttienneCanva wants to merge 1 commit into
EttienneCanva wants to merge 1 commit into
Conversation
The menu's layer surface requested exclusive keyboard focus, which makes Hyprland hold a seat grab for that surface. Pointer events outside its geometry are then discarded rather than routed onward, and since a layer surface lives on a single output, every click on any other monitor was dropped -- leaving the menu open. Clicking the scrim on the opening monitor worked because that click lands inside the grabbing surface. Switch to OnDemand keyboard focus and dismiss via HyprlandFocusGrab, matching how Omarchy's own Ui/PopupCard handles outside-click dismissal. The grab applies compositor-wide, so clicking away works from any monitor. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Author
|
Closing — opened from the wrong account by mistake. Reopening the same fix shortly from my correct account; apologies for the noise. |
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.
Problem
On a multi-monitor setup, clicking away to dismiss the menu only works if you click on the monitor the menu opened on. Clicking anywhere on any other monitor does nothing and the menu stays open.
Cause
The menu's
PanelWindowrequests exclusive keyboard focus:That makes Hyprland hold a seat grab for that surface. Pointer events outside the grabbing surface's geometry are discarded rather than routed onward, and a layer surface lives on exactly one output — so every click on any other monitor is dropped before anything can react to it.
This also explains why the existing scrim
MouseAreaworks on the opening monitor: that click lands inside the grabbing surface.The symptom is invisible on a single-monitor setup, where the grabbing surface covers the whole screen.
Fix
Use
OnDemandkeyboard focus and dismiss viaHyprlandFocusGrab, which is how Omarchy's ownUi/PopupCard.qmlhandles outside-click dismissal. The grab applies compositor-wide, so a click on any monitor clears it.Verification
Tested on Hyprland with two monitors (eDP-1 + HDMI-A-1, both scale 2), Quickshell 0.3.1, Omarchy
dev:wtypeand confirmedfilterTexttrackedt→te→ter→term.tests/manifest-test.shplus everytests/*-test.js, includingopening-screen-test.js).An intermediate attempt that added a catch-all surface on each other monitor is worth recording as evidence: that surface rendered and dimmed correctly but received zero pointer events, not even motion. A surface that paints yet gets no motion rules out input-region problems and points squarely at the seat grab.
Caveat worth your judgement
Exclusivemay have been deliberate, to guarantee the menu takes keyboard focus. WithOnDemandthe focus grab is what delivers it. I verified typing when opening over a normal window, but I did not test opening over a fullscreen window, or while another exclusive layer surface (lock screen, another launcher) holds focus. IfOnDemandproves too weak there, the alternative is to keepExclusiveand give the menu a surface per monitor — heavier, but no change to the focus model.🤖 Generated with Claude Code