Skip to content

Show no focused pane in an unfocused window - #459

Merged
amirlehmam merged 1 commit into
amirlehmam:masterfrom
strayge:feat/inactive-window-pane-focus
Nov 15, 2026
Merged

amirlehmam merged 1 commit into
amirlehmam:masterfrom
strayge:feat/inactive-window-pane-focus

Conversation

@strayge

@strayge strayge commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Problem

A wmux window without OS focus still shows its focused pane: the accent ring, the accent on its active tab, and no dim.
With two wmux windows side by side, both look like they have the keyboard, so it is hard to tell which one your typing goes to.

Change

  • Main forwards BrowserWindow focus/blur to the renderer (WINDOW_FOCUS_CHANGED, seeded by WINDOW_IS_FOCUSED). The renderer's own blur is not used because it would probably also fire when focus moves into a browser pane's <webview>, which is still the same window.
  • App.tsx toggles wmux-window-inactive on <html>. While it is set, the focused pane loses its ring and active-tab accent (transparent mode included) and dims like the other panes. In focus mode that means the whole window gets the focus-mode dim.
  • The dimming layer's visibility moved from an inline style in PaneWrapper.tsx to splitpane.css, so the window class can override it. Which pane is focused does not change.

Testing

  • npm test: 414 files passed, 2 skipped; 6701 tests passed, 10 skipped.
  • npm run typecheck is clean.
  • Checked by hand in wmux:
    • Switching to another app removes the highlight and dims the focused pane; switching back restores both.
    • Clicking into a browser pane keeps the highlight.
    • A transparent window behaves the same.

The focus ring, the active-tab accent and the missing dim stayed on the
focused pane when the wmux window lost OS focus, so with two windows side
by side both appeared to own the keyboard. Main now reports BrowserWindow
focus and blur to the renderer, which toggles a class on <html>; while it
is set the focused pane loses its ring and accent and dims like the others.
Main is the source because the renderer's own blur also fires when focus
moves into a browser pane's webview. The focused pane itself does not
change.
@amirlehmam
amirlehmam merged commit 1266792 into amirlehmam:master Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants