Skip to content

Let on-screen keyboards reach the menu - #9135

Closed
yashranaway wants to merge 6 commits into
omacom:quattrofrom
yashranaway:fix/menu-onscreen-keyboard-focus
Closed

yashranaway wants to merge 6 commits into
omacom:quattrofrom
yashranaway:fix/menu-onscreen-keyboard-focus

Conversation

@yashranaway

@yashranaway yashranaway commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Keeps the Omarchy menu usable with layer-shell on-screen keyboards. Fixes #9029.

<<<< AI wording below >>>>

Problem

Exclusive keyboard focus makes Hyprland route on-screen keyboard taps to the menu's full-screen scrim. The first tap closes the menu, and no virtual keystroke reaches search.

Fix

Prime exclusive focus when the menu opens, then allow on-screen keyboard input after the timer fires. Stop and reset the timer on close. A regression executes the actual QML handlers through open, timer tick, close, late tick and reopen.

Verification

bash test/shell.d/menu-test.sh passes. Changed Bash files pass syntax checks and git diff --check passes. The QML lifecycle regression is automated; I could not repeat live on-screen keyboard verification here.

@yashranaway
yashranaway marked this pull request as ready for review September 12, 2026 14:05
@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
quattro moved the menu onto OverlayWindow, which keeps one surface mapped between opens. Hyprland focuses an OnDemand layer only when it first maps, so a plain OnDemand would leave every reopened menu without keyboard focus. Prime with Exclusive for 75ms on each show and settle on OnDemand, as KeyboardPanel already does, and keep ExclusionMode.Auto as an override of OverlayWindow's Ignore.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by Claude Opus 5.5 and pushed one commit to this branch: 1b1b676, a merge of quattro that resolves the conflict.

Why the merge needed more than taking both sides. quattro moved the menu onto OverlayWindow (#13419), which keeps one layer surface mapped between opens. Hyprland focuses an OnDemand layer only when the surface first maps, so carrying WlrKeyboardFocus.OnDemand across as-is left the menu with no keyboard at all. On a worker, Escape did not reach it on any of three opens. The merge sets shownKeyboardFocus to Exclusive for 75ms on each show and then settles on OnDemand, the pattern shell/Ui/KeyboardPanel.qml already uses. It keeps your ExclusionMode.Auto as an override of OverlayWindow's Ignore. The onShownChanged assertion in test/shell.d/overlay-window-test.sh pinned the old one-liner, so it now matches the extended handler and still checks the layout reset on close.

Reproduction, on a worker built from the Omarchy ISO. wvkbd is not in the repositories, so a stand-in played the on-screen keyboard: a quickshell layer surface on the overlay layer, anchored along the bottom with a 200px exclusive zone, logging every press. The press came from a real uinput pointer via ydotool.

Tests. On the worker, test/shell.d/menu-test.sh passed 129/129 and test/shell.d/overlay-window-test.sh passed 20/20. ./test/cli has one failure, "vscode generated theme references current theme file", and it fails the same way on quattro, so it is not caused by this change.

Second opinion: none. The configured reviewer, Codex Medium, did not run on this item because today's review allowance was used up. Only one model has reviewed this so far.

For the maintainer. With ExclusionMode.Auto, the menu respects every reserved zone, not only an on-screen keyboard's. For everyone, the scrim no longer dims the bar, the card centres in the space below the bar, and a click on the bar goes to the bar rather than closing the menu. #9029 calls this an improvement. It is still a visible change and your call. #9756, about bar panels and on-screen keyboards, is a separate problem and this does not fix it.

It waits on a second-opinion review of 1b1b676, then on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 1, 2026
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adjusts keyboard focus behavior in the menu overlay.

The PR appears safe to merge based on the reviewed changes and resolved previous finding.

Summary

The PR changes the menu’s layer-shell focus from a brief Exclusive prime to OnDemand, allowing on-screen keyboard input, and adds tests for the focus timer’s open, close, late-tick, and reopen behavior.

  • The previous timer-lifecycle finding is addressed by the current test and its thread is resolved.
  • No new actionable finding arose from changes since that review.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Open["Menu shown"] --> Prime["Exclusive focus; start 75 ms timer"]
  Prime -->|timer fires while shown| Demand["OnDemand focus"]
  Prime -->|menu closes| Close["Stop timer; reset focus state"]
  Demand -->|menu closes| Close
  Close -->|menu reopens| Prime
Loading

Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/qua..."

Comment thread test/shell.d/menu-test.sh Resolved
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed at 4a44d2e by Claude Opus 5.5, with Codex Medium as a second opinion. Since the last review, the branch has gained the timer-lifecycle test in test/shell.d/menu-test.sh and a merge of quattro. Menu.qml has not changed.

The on-screen keyboard fix still holds. On a worker built from the Omarchy ISO, a stand-in layer-shell keyboard was anchored along the bottom with a 200px exclusive zone, and a real uinput pointer tapped it with the menu open. On quattro (f45461a), and at this head with only Menu.qml reverted, the tap never reached the keyboard and the menu closed. At this head, the tap reached the keyboard and the menu stayed open above it. Escape closed the menu on three opens in a row, and typing xyz filtered the search. menu-test.sh passed 134/134 and overlay-window-test.sh passed 20/20. ./test/cli has one failure, "vscode generated theme references current theme file", which also fails on quattro.

One regression, with two monitors. Codex raised it, and it reproduces on the worker. Open the menu on one output, wait for the 75ms prime to settle on OnDemand, then click a window on the other output. That window takes keyboard focus, the menu stays open, and Escape goes to the window instead of closing the menu. Only a click on the menu's own scrim or Super+Space dismisses it. On quattro, the same click leaves focus with the menu, and Escape closes it. KeyboardPanel has the same focus policy, and it covers this case with a transparent dismissal surface on every other output (shell/Ui/KeyboardPanel.qml:335-375). The menu takes the policy without the surfaces. Adding them would map fresh surfaces on each open on multi-monitor setups, which OverlayWindow exists to avoid. So the fix is a choice between two costs, and nothing was pushed for it.

Still for the maintainer: with ExclusionMode.Auto, the menu stops covering the bar for everyone. The scrim no longer dims the bar, the card centres below it, and bar clicks reach the bar.

This waits on @yashranaway for the two-monitor case, then on the maintainer.

@sclemance

Copy link
Copy Markdown

Cross-linking, since the two overlap on the menu: #13193 takes on the same exclusive-focus problem in OverlayWindow itself, for the menu and the emoji, clipboard and image pickers.

It is opt-in (overlays.cooperativeFocus in shell.json, off by default), and it adds dismissal surfaces on other outputs and dismisses when keyboard focus leaves, which is aimed at the multi-monitor focus case raised in review here. It is built on OverlayWindow as it stands after #14458.

Happy to fold anything from this PR into that one, or the other way round, if the maintainer prefers a single change.

@omarchybot

Copy link
Copy Markdown
Collaborator

Re-checked at 4a44d2e by Claude Opus 5.5 against current quattro (0b9dace), with Codex Medium as a second opinion. The head has not moved since the last review. Two things have changed around it: quattro moved, and a competing pull request (#13193) has come in. I only read the code this time and ran nothing, because both open questions are decisions rather than tests.

The branch conflicts with quattro again. #14458 (0a55a3c) changed shell/Ui/OverlayWindow.qml so that it maps a fresh surface on every open (visible: shown && ..., line 74) and no longer keeps a parked one. The conflict itself is small, in shell/plugins/menu/Menu.qml, but it removes the reason for this branch's design. The 75ms Exclusive prime exists because "the mapped surface never re-maps" (Menu.qml:1073 on this branch), and that is no longer true on quattro. It also changes the trade-off described in the last review. The case against adding per-output dismissal surfaces for the two-monitor regression was that they would map fresh surfaces on every open. OverlayWindow now does that anyway, so that cost is gone. I did not push a conflict resolution, because which approach lands should be decided first.

#13193 is aimed at the same bug, and neither pull request is clearly the better fix.

Codex Medium reached the same conclusion: neither should win as it stands, and the choice is the maintainer's. It agreed with a view already written down in this session's working, so its agreement is not independent. It also suggested a third option: carry this branch forward with #13193's focus handling folded in.

This waits on the maintainer to choose between fixing #9029 by default here, with the two-monitor case handled the way #13193 handles it, or an opt-in mode through #13193.

@yashranaway

Copy link
Copy Markdown
Contributor Author

Closing in favor of #13193. Its current head uses automatic cooperative focus when an on-screen keyboard reserves space and handles focus leaving on a second monitor. Current quattro maps the overlay again on each open, so this PR's 75 ms focus timer is obsolete. #13193 still needs its own review and live validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Menu blocks on-screen keyboard input: Exclusive keyboard focus routes all pointer input to the menu (touchscreen devices)

3 participants