feat: add inactive window overlay to prevent misdirected shortcuts#213
Merged
Conversation
Show a full-screen modal overlay (blurred + dimmed backdrop with a
centered "Not Active" card) when the window loses focus, so the user
can tell at a glance that keystrokes are no longer reaching this
window. This prevents accidental shortcut input into the actually
focused window - a frequent pitfall in keyboard-centric workflows.
Adds coderm.inactiveOverlay.{mode,delay,label,dimming} settings, with
README.md / README.ja.md docs kept in sync.
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a full-screen modal overlay that appears when the Coderm window loses focus, blurring and dimming the workbench behind a centered "Not Active" card. This makes it obvious at a glance that keystrokes are no longer reaching this window, preventing accidental shortcut input into the actually-focused window — a frequent pitfall in keyboard-centric (Neovim/Vim) workflows.
Changes
src/vs/workbench/contrib/coderm/browser/inactiveOverlay.ts: Workbench contribution tracking window focus viaIHostService.onDidChangeFocusand toggling a full-screen overlay (blurred + dimmed backdrop with a glass card). Follows thecursorAutoHide.tstemplate structure.coderm.contribution.ts: registers the new contribution via side-effect import (alphabetical).README.md/README.ja.md: documents the new settings (kept in sync).New settings
coderm.inactiveOverlay.modestring"on"on(blur + dim) /off(disabled) /blur-off(dim only, no blur)coderm.inactiveOverlay.delaynumber300coderm.inactiveOverlay.labelbooleantruecoderm.inactiveOverlay.dimmingnumber0.45on/blur-off)Implementation notes
IHostService.onDidChangeFocusonly (covers main + auxiliary windows, already debounced viaEvent.latch); raw DOMblur/focusis intentionally avoided to prevent focus-recursion flicker.tabindex-free), so focus is never stolen — the OS-level focus change is left to happen naturally.delayms, default 300) to avoid flicker during brief focus switches (e.g. Cmd+Tab); focus restoration hides immediately and cancels any pending show.Verification
npm run compile, 0 errors)mode: blur-offshows dim-only;mode: offdisables entirelylabel: falsehides the card;dimmingadjusts darkness in real time🤖 Generated with Claude Code