fix/hyprland scrolling focus v2 - #1468
Open
justindotdevv wants to merge 4 commits into
Open
Conversation
On Hyprland, exclusive keyboard interactivity on the layer-shell surface blocks the compositor from cleanly handing off focus to the target window. Force OnDemand interactivity on Hyprland regardless of the closeOnFocusLoss setting, while preserving the existing behavior on other compositors. Refs: vicinaehq#1329
On Hyprland, focusWindowSync was called synchronously during action execution, before the launcher had actually hidden. The layer-shell surface was still holding keyboard focus, causing the focus command to be silently dropped. Defer focusWindowSync to the next event loop iteration using QTimer::singleShot(0, ...), guaranteeing it runs after hide() completes. Remove the dead eval hl.dispatch(...) line from focusWindowSync and closeWindow. Hyprland 0.55.2 does not support eval with the non-Lua config manager. Add dispatch layoutmsg center to focusWindowSync to explicitly instruct the scrolling layout to scroll the viewport to the focused window. Refs: vicinaehq#1329
justindotdevv
force-pushed
the
fix/hyprland-scrolling-focus-v2
branch
from
June 1, 2026 08:45
402779d to
7d3b3f5
Compare
justindotdevv
marked this pull request as ready for review
June 1, 2026 09:05
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.
Fixes #1329
On Hyprland with the scrolling layout, the window switcher did not focus the target window or scroll the viewport.
Changes:
focusWindowSyncwithQTimer::singleShot(0, ...)so it runs after the launcher hides.OnDemandkeyboard interactivity on Hyprland to allow clean focus handoff.evalAPI calls and addlayoutmsg centerto scroll the viewport.Tested on Hyprland 0.55.2 with scrolling layout.
Note
Difference from v1 (PR #1330): The original PR attempted to fix this by adding a
deferUntilWindowHidden()mechanism toNavigationController, detecting the scrolling layout at runtime, and polling Hyprland until the window reported as focused before sendinglayoutmsg center. It did not address theexclusivekeyboard interactivity issue and still failed. This PR takes a much simpler approach: forceOnDemandinteractivity on Hyprland (regardless ofcloseOnFocusLoss), deferfocusWindowSyncdirectly inFocusWindowActionwithQTimer::singleShot(0, ...), and sendfocuswindow+layoutmsg centeratomically in a single[[BATCH]]— no polling, no layout detection, noNavigationControllerchanges, and no refactor of unrelated systems.AI assistance: Developed with OpenCode (Kimi k2.6). All changes were reviewed and tested locally.