Skip to content

Fix panel close throwing on read-only centerHoverRevealSuppressed - #8

Closed
DerailleurAgile wants to merge 1 commit into
salemsayed:mainfrom
DerailleurAgile:fix/center-hover-reveal-suppressed-readonly
Closed

DerailleurAgile wants to merge 1 commit into
salemsayed:mainfrom
DerailleurAgile:fix/center-hover-reveal-suppressed-readonly

Conversation

@DerailleurAgile

Copy link
Copy Markdown

Fixes #7.

A recent Omarchy upgrade (currently 4.0.3-1) changed the shell's bar API: centerHoverRevealSuppressed moved from a writable property to readonly, mutable only via bar.setCenterHoverRevealSuppressed(). This plugin still writes the property directly, which now throws a TypeError. Since that call runs before root.controller.hide() inside close(), the panel never hides — it stays open holding keyboard focus (keyCatcher.forceActiveFocus() from open()), locking up keyboard input for the session. Nothing changed on the plugin side; this is purely fallout from the platform upgrade.

Matches the fix Omarchy's own stock weather/clock panels already carry for the same upgrade: try the method, fall back to the legacy property for older shells.

 function setCenterHoverRevealSuppressed(value) {
-    if (root.bar && "centerHoverRevealSuppressed" in root.bar)
+    if (root.bar && typeof root.bar.setCenterHoverRevealSuppressed === "function")
+      root.bar.setCenterHoverRevealSuppressed(value)
+    else if (root.bar && "centerHoverRevealSuppressed" in root.bar)
       root.bar.centerHoverRevealSuppressed = value
 }

Testing:

  • Confirmed the pre-fix build throws TypeError: Cannot assign to read-only property "centerHoverRevealSuppressed" in journalctl --user on every panel close, only after upgrading to Omarchy 4.0.3-1 — not reproducible on the older shell API.
  • After the fix + omarchy restart shell (hot-reload/rescanPlugins didn't pick up the change to this panel — worth a note for other contributors), cycled open/close/toggle/toggle over IPC (omarchy-shell io.github.salemsayed.omaonedrive ...) with no warnings in the journal.

🤖 Generated with Claude Code

https://claude.ai/code/session_0114NmAoUj6rcpi6z4GM5FHx

A recent Omarchy upgrade (4.0.3-1) changed the shell's bar API:
centerHoverRevealSuppressed moved from a writable property to
readonly, mutable only via bar.setCenterHoverRevealSuppressed().
This plugin still wrote the property directly, which now throws a
TypeError. Since that call ran before root.controller.hide() inside
close(), the panel never hid -- it stayed open holding keyboard focus
(keyCatcher.forceActiveFocus() from open()), locking up keyboard
input for the session.

Matches the fix Omarchy's own stock weather/clock panels already
carry for the same upgrade: try the method, fall back to the legacy
property for older shells.

Fixes salemsayed#7

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114NmAoUj6rcpi6z4GM5FHx
@salemsayed salemsayed added bug Something isn't working duplicate This issue or pull request already exists labels Sep 14, 2026
@salemsayed

Copy link
Copy Markdown
Owner

The panel setter fix is included in v1.6.0 through #5, which also hides the panel before touching the bar API so an API error cannot retain keyboard focus. Verified on an Omarchy 4.0.3 QEMU desktop with Escape, outside click, bar click, IPC close/toggle, and keyboard focus restoration. Closing this overlapping implementation as superseded; thank you for the fix and diagnosis.

Release: https://github.com/salemsayed/omaonedrive/releases/tag/v1.6.0

@salemsayed salemsayed closed this Sep 14, 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.

Panel can't close after Omarchy's centerHoverRevealSuppressed became read-only — traps keyboard focus

2 participants