Skip to content

Force-close KeyboardPanel when owner close() throws - #13648

Open
AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:cursor/fix-keyboard-panel-close-e0d3
Open

AnPod wants to merge 2 commits into
omacom:quattrofrom
AnPod:cursor/fix-keyboard-panel-close-e0d3

Conversation

@AnPod

@AnPod AnPod commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #13382

A throwing plugin close() left the panel overlay mapped and locked all pointer input.

Change

  • Force-close KeyboardPanel when the owner's close() throws so the overlay cannot stick mapped

Test plan

  • Focused shell test on the branch
  • Trigger a plugin close that throws; pointer input should remain usable

Co-authored-by: AnPod <AnPod@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/fix-keyboard-panel-close-e0d3 branch from f6f1003 to c9305ee Compare September 29, 2026 21:14
@omarchybot omarchybot added the bug Something isn't working label Oct 1, 2026
The previous test grepped KeyboardPanel.qml for the warning text and for `root.open = false`, which passes with the fallback assignment commented out. This loads a real KeyboardPanel under quickshell with one owner whose close() throws and one whose close() works, and checks that the exception is contained, both panels close, the bar popout is released and both overlays unmap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 3, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and reproduced on a disposable Omarchy VM. The fix works: with a bar widget whose close() throws, clicking outside the panel now unmaps the overlay and the desktop takes clicks again.

How it was checked. On the worker I made the clock panel's close() throw, opened the calendar over IPC, and clicked outside it with a virtual mouse, then counted omarchy-keyboard-panel layers in hyprctl layers. On quattro and on this branch with shell/Ui/KeyboardPanel.qml reverted, the overlay stayed mapped through repeated clicks, as #13382 describes. On this branch it unmapped on the first click and logged the new warning. ./test/cli and ./test/shell ran on the same worker: the failures are identical to quattro's (tests needing node, which the worker image lacks, plus one vscode theme test), so none come from this change.

Pushed: 5e3ae8e, a runtime test in place of the grep test. The original keyboard-panel-close-test.sh only grepped KeyboardPanel.qml for the warning text and root.open = false, so it still passed with the fallback commented out. The new test loads a real KeyboardPanel under quickshell (fixture in test/shell.d/fixtures/keyboard-panel-close/, same harness as lock-password-overflow-test.sh). It uses one owner whose close() throws and one whose close() works, and checks four things: the exception is contained, both panels close, the bar popout is released, and both overlays unmap. It passes on this branch and fails on all four with the fix reverted.

Left for the maintainer, not a change requested of you. root.open = false replaces the panel's open: root.opened binding, and the owner's opened stays true because its close() never reached controller.hide(). Once the force-close has fired, that panel will not open again until the shell restarts; I confirmed this on the worker. That is the "this panel misbehaves" outcome the issue asks for, and much better than a desktop-wide lockout, but it is a trade-off. Escape, omarchy-shell <target> close and the shell's hide still call the owner directly and do not go through this guard. Each still leaves the overlay up after a throw, but a click outside now clears it.

Second opinion: Codex Medium reviewed the original head and raised the vacuous test and the binding trade-off above; it reviewed the new test commit and found nothing. Its independence from this review is not guaranteed.

Waiting on the maintainer, and on CI, which has not reported on this pull request.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Adds error handling to keyboard panel close logic.

The PR should not merge until a panel can recover and reopen after its owner's close throws.

Findings

  1. P1 Thrown close breaks reopening ▶
  2. P2 Mapping is not tested ▶

Summary

The PR catches exceptions from a KeyboardPanel owner's close() and forces the panel closed, with a new Quickshell fixture and shell test. The fallback releases the immediate input lock, but it also breaks the binding needed to reopen the panel.

Reviews (1) · Last reviewed commit: "Test KeyboardPanel close against a throw..."

} catch (e) {
console.warn("KeyboardPanel: owner close() threw, forcing close:", e)
}
root.open = false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Thrown close breaks reopening When an owner's close() throws, assigning root.open = false breaks the panel's open: root.opened binding. The overlay closes, but later changes to the owner's open state cannot reopen it, leaving the plugin and its panel out of sync until the shell reloads.

Comment on lines +80 to +81
function runChecks() {
assertTrue(throwingPanel.open && workingPanel.open, "both panels start open")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Mapping is not tested The fixture checks visible after closing but never establishes that either overlay was mapped first. Since visible follows the panel's logical state and card opacity, the test can pass without exercising the mapped overlay or the pointer-input failure it is meant to prevent.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A throwing plugin close() leaves the panel overlay mapped and locks all pointer input

3 participants