fix(popups): delay focus grab to prevent immediate dismissal#82
Open
enhulsman wants to merge 1 commit intoAxenide:mainfrom
Open
fix(popups): delay focus grab to prevent immediate dismissal#82enhulsman wants to merge 1 commit intoAxenide:mainfrom
enhulsman wants to merge 1 commit intoAxenide:mainfrom
Conversation
The HyprlandFocusGrab was activated immediately via `active: presetsOpen` / `active: overviewOpen`, which could fire before the PanelWindow surface was fully mapped. This caused onCleared to trigger instantly, closing the popup before the user could interact with it. Fix: replace the direct property binding with a 50ms Timer that starts when the popup opens. The grab is explicitly deactivated when the popup closes, preventing stale grab state. Affected popups: OverviewPopup, PresetsPopup.
f294e5b to
8678573
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.
Problem
The overview never actually stayed open for me. Every time I hit my keybind it would either close immediately (seeing nothing) or flash briefly before disappearing. The presets popup had the same issue occasionally.
After looking into it,
HyprlandFocusGrabis bound directly viaactive: overviewOpen(andactive: presetsOpen), which activates the grab the instant the QML property changes. On Wayland, thePanelWindowsurface may not yet be mapped by the compositor at that point, so Hyprland processes the grab request, finds no valid surface, and immediately firesonCleared, closing the popup before you can interact with it.Essentially a race condition that depends on compositor timing.
Solution
Replace the direct
activeproperty binding with a 50msTimerthat starts when the popup opens. This gives the Wayland compositor time to map the surface before the focus grab is activated. On close, the timer is stopped and the grab is explicitly deactivated.50ms is conservative since surface mapping typically completes within a single frame (~4-16ms), but it provides a safe margin without being perceptible.
Files Changed
modules/widgets/overview/OverviewPopup.qml: Timer-based grab activation, removed direct bindingmodules/widgets/presets/PresetsPopup.qml: Same patternTesting
onCleared