Skip to content

Close panel overlays even when a plugin close() throws - #13465

Closed
AnPod wants to merge 1 commit into
omacom:quattrofrom
AnPod:fix/panel-close-throws-strands-overlay
Closed

AnPod wants to merge 1 commit into
omacom:quattrofrom
AnPod:fix/panel-close-throws-strands-overlay

Conversation

@AnPod

@AnPod AnPod commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Ui/KeyboardPanel.qml and Ui/PopupCard.qml delegate close() straight to the panel owner and only set root.open = false when there is no owner. An owner close() that throws leaves the overlay mapped with its full-screen input region intact (#13382): every click on the desktop lands on the dead surface, and every dismissal path (Esc, outside-click, omarchy-shell <target> close, shell hide) funnels back into the same throwing call — only a shell restart recovers.

Both now wrap the delegation in try/catch: on a throw they log a warning naming the failure and force root.open = false, which unmaps the window and releases the input region. The happy path is byte-for-byte unchanged.

Fixes #13382

Testing

  • No existing shell.d test covers these Ui components; QML change verified for structural correctness (id: root/property bool open present in both files, console.warn + JS try/catch are standard QML).
  • Suggested visual/behavioral check per agents/skills/visual-verification.md: a dev-linked shell with a plugin whose close() throws throw new Error('x') — Esc/outside-click must now dismiss the panel and the log must show the warning.

KeyboardPanel and PopupCard delegate close() straight to the owner and
only fall back to root.open = false when there is no owner. An owner
close() that throws therefore leaves the overlay mapped with a
full-screen input region: every click lands on the dead surface, and
Esc, outside clicks, and omarchy-shell close all funnel into the same
throwing path. Force root.open = false from the catch and log why.

Fixes omacom#13382
@omarchybot omarchybot added the bug Something isn't working label Oct 3, 2026
@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

For the maintainer's queue: four open PRs now make this same fix for #13382: this one, #13460 (also yours), #13648 and the older #11751. All of them wrap owner.close() in try/catch and force root.open = false. #13648 has been verified, and its review notes one trade-off: a panel that was force-closed this way won't reopen until the shell restarts. @AnPod, would you mind closing #13460 and whichever of this pair you don't want to carry? Then only one candidate per approach is left.

@omarchybot

Copy link
Copy Markdown
Collaborator

Closing this as a duplicate of #13460, which was opened 21 minutes earlier against quattro and makes the same change.

Both pull requests fix #13382 in the same two files, shell/Ui/KeyboardPanel.qml and shell/Ui/PopupCard.qml, in the same way: close() wraps the delegated owner.close() in try/catch, logs a warning when it throws, and falls back to root.open = false. The control flow differs only in layout: #13460 returns early after a successful owner.close() and sets root.open = false after the try, while this one sets it inside the catch and the else. The behaviour is identical on every path. #13460 also adds test/shell.d/panel-close-safety-test.sh, and has already been verified on a worker reproducing #13382.

Compared by reading both diffs against quattro; nothing was run for this one, since #13460 already carries the same change through verification. The duplicate check was made by Claude Opus 5.5, with a separate check by the second opinion omabot close-duplicate runs.

For the maintainer: #11751 and #13648 also fix #13382 and remain open as competing fixes, which is the maintainer's choice. One difference worth knowing: on a throw, #11751 hides the panel through owner.controller.hide() where it can, which keeps open bound to the owner; this pull request and #13460 assign root.open = false, which breaks that binding, so a panel that was force-closed this way does not reopen until the shell restarts.

If this is wrong, and this pull request differs from #13460 in a way that matters, it can be reopened.

@omarchybot omarchybot added the duplicate This issue or pull request already exists label Oct 7, 2026
@omarchybot omarchybot closed this Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working duplicate This issue or pull request already exists

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