fix: use canceled instead of performed for MainMenu shortcut to prevent Cmd+Tab regression - #9744
fix: use canceled instead of performed for MainMenu shortcut to prevent Cmd+Tab regression#9744decentraland-bot wants to merge 2 commits into
Conversation
…nt Cmd+Tab opening Explore Menu PR #6576 introduced ExplorePanelPlugin.cs which subscribed to MainMenu.performed, re-introducing the macOS Cmd+Tab bug that PR #7433 had fixed. When .performed is used, macOS Cmd+Tab causes the Tab key press event to fire in Unity (the OS captures Cmd but not Tab), which opens the Explore Menu. With .canceled, the menu only opens on key release, so switching apps no longer triggers it. Closes #7348
🚦 CI StatusBuild skipped — no changes detected under Warnings not reduced: 13156 => 13156 — remove at least 1 warning to merge. Warnings/errors in files changed by this PR (17)All Unity tests passed ✅
|
|
Slack notification sent to #explorer-ext-contributions for external review. |
decentraland-bot
left a comment
There was a problem hiding this comment.
PR Review: fix: use canceled instead of performed for MainMenu shortcut to prevent Cmd+Tab regression
STEP 2 — Root-cause check ✅
Problem: PR #6576 ("replace shared space manager", April 2026) introduced ExplorePanelPlugin.cs which subscribes to dclInput.Shortcuts.MainMenu.performed. This re-introduced the Cmd+Tab regression that PR #7433 had originally fixed by switching from .performed to .canceled.
Root cause: On macOS, Cmd+Tab causes the OS to capture the Cmd key, but the Tab key press still fires in Unity as a .performed event — triggering the Explore Menu to open. With .canceled (key release), the release happens in the other app, so Unity never sees it.
Verdict: The diff fixes the actual cause — the wrong Input System event phase — not a symptom. PASS.
STEP 3 — Design & integration ✅
No new units introduced. This is a 3-line correction to an existing subscription in an existing plugin. No new classes, no new state, no new lifecycle owners.
Pattern consistency verified. ExplorePanelController.cs already uses .canceled for MainMenu:
dclInput.Shortcuts.MainMenu.canceled += OnCloseMainMenu;dclInput.Shortcuts.MainMenu.canceled -= OnCloseMainMenu;
The two subscribers are complementary — the plugin opens the menu when State is ViewHidden, while the controller closes the menu when it is visible. No conflict.
Teardown trace:
- Subscribe:
dclInput.Shortcuts.MainMenu.canceled += OnInputShortcutsMainMenuCanceledAsync;(InitializeAsync, line 370) - Unsubscribe:
dclInput.Shortcuts.MainMenu.canceled -= OnInputShortcutsMainMenuCanceledAsync;(Dispose, line 357) - ✅ Properly paired.
STEP 4 — Member audit ✅
OnInputShortcutsMainMenuCanceledAsync — private method, used solely as an event handler (1 consumer: the input event subscription). Appropriate for its role. The rename from ...Performed... to ...Canceled... correctly reflects the new event phase.
STEP 5 — Line-level review ✅
No blocking issues found. All three changes are symmetric and correct:
- Subscribe line updated to
.canceledwith renamed handler - Unsubscribe line updated to
.canceledwith renamed handler - Method renamed to match the event phase
No resource leaks, no security issues, no performance concerns, no missing error handling.
Security review ✅
No security issues found. The change only affects which Input System event phase triggers the menu — no secrets, injection surfaces, auth changes, or sensitive data exposure.
STEP 8 — Non-blocking warnings
None.
REVIEW_RESULT: PASS ✅
COMPLEXITY: SIMPLE
COMPLEXITY_REASON: Single-file fix changing input event subscription from .performed to .canceled — no ECS, async, or architecture changes.
QA_REQUIRED: YES
Reviewed by Jarvis 🤖 · Requested by Pravus (<@UDJQDQC0Z>) via Slack
This comment has been minimized.
This comment has been minimized.
|
PR #9744, run #31812163080 Builds: Windows change, Windows baseline, macOS change, macOS baseline How to read this table
Intel Core i5
Exception breakdown
Apple M1
|
|
✅ PR reviewed and approved by QA on both platforms following the PR test instructions. Build: Test results:
Unrelated errors noted (do not affect verdict):
Verdict: PASS ✅ Root cause and fix confirmed: 14.08.2026_16.11.09_REC.9744.mp4 |
Pull Request Description
What does this PR change?
Fixes a regression where pressing
Cmd+Tabon macOS to switch between the Explorer and another app opens the Explore Menu when returning to the Explorer.Root cause: PR #6576 ("replace shared space manager", merged April 2026) introduced
ExplorePanelPlugin.cswhich subscribes todclInput.Shortcuts.MainMenu.performed. The original fix in PR #7433 had correctly changed this from.performedto.canceledin the previous files, but the new plugin re-introduced the old.performedbehavior.When
.performedis used, macOSCmd+Tabcauses the Tab "performed" event to fire in Unity — the OS captures the Cmd key but the Tab key press still reaches Unity, triggering the Explore Menu to open. With.canceled, the menu only opens on key release, and since the release happens in the other app, Unity never sees it.Changes:
ExplorePanelPlugin.cs: ChangedMainMenu.performed→MainMenu.canceledfor both subscribe and unsubscribeOnInputShortcutsMainMenuPerformedAsync→OnInputShortcutsMainMenuCanceledAsyncfor consistency withExplorePanelController.cs(which already uses.canceled)Closes #7348
Test Instructions
Steps (standard run):
metaforge explorer run XXXX # ← replace with this PR numberExpected result:
Cmd+Tabto switch to another app (e.g. Slack, VSCode)Cmd+Tabto return to the ExplorerSteps (fresh account):
metaforge account create --clear metaforge explorer run XXXX # ← replace with this PR numberExpected result:
Same as above —
Cmd+Tabshould not open the Explore Menu.Prerequisites
Test Steps
Cmd+Tabto switch to another applicationCmd+Tabto return to the ExplorerTabdirectly still opens the Explore Menu as expectedAdditional Testing Notes
Quality Checklist
ExplorePanelController.cs)🤖 Created via Slack with Claude
Requested by Pravus (<@UDJQDQC0Z>)