Repository navigation
Conversation
The filter was a Text element fed by keyCatcher's Keys.onPressed, which appended event.text one character at a time. Qt delivers input-method events -- the preedit an input method shows while composing, and the text it commits -- only to an item that answers inputMethodQuery, and in QML that means TextInput or TextEdit. An Item with a key handler is invisible to that protocol, so composing Chinese, Japanese or Korean through fcitx5 either dropped the text or left the raw Latin keysyms behind: typing the bopomofo for 你好 filled the filter with "su3cl3". Focus now lives on a TextInput that forwards every key to keyCatcher first, so the menu keeps all of its own bindings and only the keys the handler leaves unaccepted -- printable characters, paste, IME commits -- reach the search line. The modal branch accepts unconditionally, so keys pressed while the uninstall confirmation is up cannot type into the field behind it. The line stays an append-only buffer with no caret and no selection, so the menu looks and behaves exactly as before for Latin input.
Verification: Omacloud Test Harness✅ Passed — All 114 unit test assertions passed. Live QML
Graphical Menu Search VerificationVerified the refactored
Screenshots Captured During Run:
Triage Insights for Upstream
TAP Assertion Breakdown (114 / 114 OK)Verified automatically with Omacloud Test Harness · Run duration: 8.4s |
|
Tested this on Omarchy 4.0.4 with fcitx5 (Hangul), applying only this PR's I found two regressions, both about keys reaching the new 1. Alt chords type their letter into the search line Steps: open the menu and press Alt+a, Alt+1 or Alt+f. The search line shows The old accumulator only took text when the modifiers were none or Shift. With that branch gone, unaccepted Alt chords fall through to 2. Input-method text leaks into the search line behind the delete confirmation Steps: search keyCatcher's "swallow everything while the modal is up" only covers key events. fcitx5 delivers composed text as an Fix I tested locally (on top of this PR): // keyCatcher Keys.onPressed, after the Return/Enter/Right branch
} else if (event.modifiers & (Qt.AltModifier | Qt.MetaModifier)) {
// Alt/Meta chords belong to other shortcuts, as the old accumulator
// assumed. Left unaccepted, TextInput would insert their text.
event.accepted = true
}// filterInput
// Input-method text arrives as an InputMethodEvent, not a key event,
// so keyCatcher's modal swallow never sees it. A read-only TextInput
// rejects input-method events and tells the IME it is not a target.
readOnly: root.deleteConfirmOpenWith both changes: Alt+a and Alt+1 no longer type anything, and Hangul no longer leaks while the dialog is open. Hangul search (터미널), Ctrl+V and Backspace still work after the fix. Root cause and fix drafted with help from Claude; testing done by me. |
|
I'll follow up with a PR for regression 2 only: Leaving the Alt/Meta swallow out. I didn't test AltGr, and those chords are part of what this PR keeps typable. |
|
Thank you for this. The work is carried forward in #15508, which brings the still-missing parts of Japanese, Chinese and Korean setup together into one change, so I am closing this in its favour. The real text input for the menu search line is in #15508, credited to you and to TAE58 as co-authors, together with TAE58's two fixes: Alt and Super chords no longer type their letter, and the line is read-only behind the uninstall confirmation. On a worker, Mozc now composes にほんご and commits 日本語 into the search line, where This was checked against |


The menu's search line cannot be typed into with a CJK input method. Composing Chinese, Japanese or Korean through fcitx5 either drops the text or leaves the raw Latin keysyms behind: typing the bopomofo for 你好 fills the filter with
su3cl3, so the menu cannot be searched in those languages. BothSUPER + SPACEandSUPER + ALT + SPACEare affected — they are the sameMenu.qml.Why
The filter was a
Textelement fed bykeyCatcher'sKeys.onPressed, which appendedevent.textone character at a time. Qt delivers input-method events — the preedit an input method shows while composing, and the text it commits — only to an item that answersinputMethodQuery, and in QML that meansTextInputorTextEdit. AnItemwith a key handler is invisible to that protocol.Layer shell is not the problem: Hyprland grants
zwp_text_input_v3to layer surfaces, and a plainTextInputin aPanelWindowwithkeyboardFocus: Exclusive— byte-for-byte the menu's own window configuration — composes CJK correctly.How
Focus moves to a
TextInputthat forwards every key tokeyCatcherfirst (Keys.forwardTowithKeys.priority: Keys.BeforeItem), so the menu keeps all of its own bindings and only the keys the handler leaves unaccepted — printable characters, paste, IME commits — reach the search line. The hand-rolled character accumulator is gone.Util.editsFilterstays where it is, so Backspace / Ctrl+Backspace / Ctrl+U are still handled once, by the menu.The modal branch now accepts unconditionally, because an unhandled key would otherwise fall through and type into the search line behind the uninstall confirmation.
The line stays an append-only buffer with no caret and no selection, so the menu looks and behaves exactly as before for Latin input.
cursorDelegate: Item {}is what actually holds the caret hidden — a constantcursorVisible: falsedoes not, because Qt turnscursorVisibleback on by itself on every focus change.Scope
This is about typing into the menu: the input experience for CJK users, and nothing more. It does not install, configure or detect an input method — getting fcitx5 and an engine onto the machine, and wiring up the environment for it, is a separate concern and deliberately not part of this PR. Nothing here is specific to Chinese either; Japanese and Korean users hit the same code path, and Latin input is unchanged.
Verified
On Arch with Hyprland, quickshell 0.3.1, fcitx5 + fcitx5-chewing.
The fix works, against a controlled negative. Same session, same script, same input method,
fcitx5-remote -oas the oracle:im=chewingNo matches for "你好"im=keyboard-ussu3cl3Both entry points were run separately (
omarchy-menu toggleandomarchy-menu toggle apps).Nothing looks different. Compared against screenshots of the unpatched shell: search line 0.0026 differing pixels of 89600, whole menu card 0.0052, full 3840x2160 frame 73 px — the clock in the bar.
The caret and selection stay invisible. 0 differing pixels across Ctrl+A, Home, Shift+Left, Ctrl+Left and Ctrl+V, and across 8 frames spanning 2.8 s to catch a blink.
Keys cannot leak past the modal. With the uninstall confirmation up, typing
zzzleaves the full frame byte-identical; Escape then cancels it and typing resumes normally.One behaviour does change, for the better: Ctrl+V now pastes into the filter. The old accumulator required
NoModifierorShiftModifier, so paste did nothing at all../test/shellgives identical results on the patched and unpatched trees for every menu-related test file.The same defect exists elsewhere
Four sibling plugins have the byte-same
Keys.onPressedaccumulator and cannot take CJK input either:shell/plugins/reminders/ReminderFlow.qml— the worst of them, since this is text entry, not a filtershell/plugins/clipboard/Clipboard.qmlshell/plugins/emojis/Emojis.qmlshell/plugins/image-picker/ImagePicker.qmlI've kept this PR to the menu so it stays reviewable and because it's the surface people hit first. Happy to follow up with the other four, verified the same way, if this shape looks right to you.
How this relates to the open menu-input PRs
Three open PRs are working on this same search line. Where this one overlaps them, and where it does not:
#7659 and #8023 patch the exact statement this PR deletes. Both fix the accumulator's modifier test —
event.modifiers === Qt.NoModifier || event.modifiers === Qt.ShiftModifierdrops numpad digits, which Qt stamps withKeypadModifier, and AltGr characters, which it stamps withGroupSwitchModifier. ATextInputinsertsevent.textwithout consulting the modifiers at all, so the menu no longer has that decision to get wrong:+, numpad digits and AltGr symbols type, while Ctrl and Alt chords still stay withkeyCatcher, which sees every key first. Whichever of the three lands first, the others need a rebase; they edit the same line.#8023 is only half superseded. Its
Util.extendsFilteralso servesImagePicker.qml, which this PR does not touch, so the helper keeps a caller and the image picker keeps the bug. Note that its new test asserts the menu routes throughUtil.extendsFilter, which this PR makes untrue of the menu. If this shape is the one you want, the follow-up above would take the image picker off the helper too, andextendsFiltercould go away with the last accumulator.#9135 is orthogonal, and I am not claiming it. It changes the layer-shell surface —
keyboardFocusfromExclusivetoOnDemand,exclusionModefromIgnoretoAuto— so an on-screen keyboard can appear and take pointer input. Different mechanism, different line; this PR neither fixes nor conflicts with it. I have tested this change only againstExclusive, the menu's current configuration, and have not tested an on-screen keyboard at all, so I make no claim about how the two compose beyond not touching the same code.🤖 Generated with Claude Code