Repository navigation
Conversation
The clipboard manager is a fullscreen layer holding exclusive keyboard focus. Clicking an entry moves the pointer over whichever tiled window sits behind the centred card, and once the layer unmaps follow_mouse hands focus to it — so the synthetic Shift+Insert landed in the wrong window and that window took focus. Record the focused toplevel's address when the manager opens and pass it to the paste helpers as --window. The helpers wait for the layer to close, refocus the origin window by address (hl.dsp.focus with a focuswindow fallback), and confirm it stuck before typing — the same shape as the emoji picker's mouse-selection fix. Keyboard selection was never broken because the pointer never moved; behaviour without --window is unchanged. Also skip the pdeathsig assertion when setpriv is unavailable so the suite runs off Linux. Fixes omacom#12987
Automated AI review
Outcome: The diagnosis and design match the Hyprland 0.56.2 source, but the head commit's refocus call uses the legacy dispatcher syntax, which Hyprland rejects under Omarchy's Lua config. On the default setup a mouse-picked entry still pastes into the window under the pointer. This is a source-level finding; it was not reproduced on a live session. Verified (source):
Refocus dispatch is rejected under the Lua configCommit The legacy dispatcher table is only consulted on the non-Lua branch. This code is the same in 0.55.0, 0.56.0, 0.56.2 and current The new tests pass because the Impact: #12987 remains unfixed on Omarchy's shipped Lua config. Mouse picks with the pointer over another window also gain about 0.6 s of extra delay. Suggested change: Restore the first commit's Lua-first form ( Empty-workspace origin once the dispatch worksThis is latent at the current head, because the rejected dispatch masks it. It appears as soon as the Lua form is restored. Quickshell 0.3.1 ignores an
Impact: An unexpected workspace jump, with clipboard content pasted into a window the user was not looking at. A multi-monitor setup changes the route, not the outcome. Suggested change: Record the origin only when the active toplevel is on the focused workspace, for example Smaller notes:
Review informationTest scope: Source-only review of head AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, with targeted cross-checking of single-sourced claims, and an Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
You are right, thanks. Dropping the Lua form in a036f1b was a mistake on my part. Fixed in c07a61c:
|
Automated AI review
Follow-up at Outcome: On Omarchy's shipped Lua config, four earlier points are resolved and the empty-workspace point is resolved for regular workspaces. One narrower variant remains through an empty special workspace (below), traced in source only. No other regressions against base were found in the changed code.
Verified:
Empty special workspace still lets a stale origin throughQuickshell 0.3.1 does not track special workspaces: it has no In base the paste reaches no window and the scratchpad stays open. The same blind spot means a window on a special workspace never gets an origin. With two windows on the scratchpad and the click over the other one, the #12987 misroute remains there. That part is unchanged from base. Impact: Narrow. It needs an empty special workspace (for example Suggested change: Base the origin on Hyprland's own focus events instead of Quickshell's workspace model. For example, track Smaller notes:
Review informationTest scope: Follow-up of head AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks for this, and for turning the earlier review around so quickly. This fix competes with #12991, which was opened a day earlier for the same issue (#12987) and takes the same approach: it records the origin window in One concrete difference also favours #12991. Here, if the origin never becomes active again (it was closed, or the refocus does not take), both What this adds over #12991 is the named Checked by reading both diffs against |
Summary
follow_mouseimmediately refocuses the window under the pointer; the syntheticShift+Insert(0.15s later) went thereClipboard.qmlnow records the focused toplevel's address inopen()(with alastToplevelAddressfallback for the race where the signal already moved on) and passes it to both paste helpers as--windowhl.dsp.focuswith afocuswindowfallback), polling until it sticks — the same shape as the emoji picker's mouse-selection fix in Fix Emoji Picker for all apps with both keyboard and mouse #8573--windowbehaviour is unchanged;--copy-onlynever refocusesAlso guards the pdeathsig watcher assertion behind
command -v setprivso the suite runs off Linux.Fixes #12987
Test plan
bash test/shell.d/clipboard-test.sh— new behavioural assertions: both helpers refocusaddress:0x…before typing, normalise bare addresses, stop once the origin window is active, and leave focus alone without--window; QML wiring assertions coveropen()recording and the--windowhandoff. 84 assertions pass.SUPER+CTRL+V, click an entry → paste lands in the right window and focus is unchanged