Skip to content

Fix dialogs opening behind undocked video/audio windows (#11971)#11978

Merged
niksedk merged 1 commit into
mainfrom
fix/dialogs-behind-undocked-windows-11971
Jun 29, 2026
Merged

Fix dialogs opening behind undocked video/audio windows (#11971)#11978
niksedk merged 1 commit into
mainfrom
fix/dialogs-behind-undocked-windows-11971

Conversation

@niksedk

@niksedk niksedk commented Jun 29, 2026

Copy link
Copy Markdown
Member

Fixes #11971

Problem

With the video controls / audio visualizer undocked, opening Settings (also Shortcuts, Word lists, Speech to Text) makes the dialog appear behind the undocked Audio visualizer window. The Find dialog is unaffected. Clicking Apply in Settings sends it behind again.

Root cause

Undocked windows float above the main window via WindowService.KeepTopmostWhileOwnerActive(window, Window!), which sets Topmost = owner.IsActive || child.IsActive. So while the main window is active, they have Topmost = true.

  • Find (works): shown via ShowWindow plus KeepTopmostWhileOwnerActive, so it joins the same "topmost-while-active" tier and, activated last, sits on top.
  • Settings / Shortcuts / Word lists / Speech to Text (broken): shown via ShowDialogAsync → plain window.ShowDialog(owner) with no topmost handling, so they are normal (non-topmost) windows and render beneath the Topmost=true undocked window.

The deferred topmost-recompute doesn't rescue it: a modal dialog is an owned child of the main window, so the main window never fires Deactivated, the undocked window's Topmost is never lowered, and the dialog stays hidden. "Apply" re-activates the main window and re-asserts the same state.

Fix

Apply KeepTopmostWhileOwnerActive(window, owner) to dialogs in both ShowDialogAsync overloads (WindowsService.cs). The dialog joins the topmost tier — activated last, it sits above the undocked windows — and, unlike a blanket Topmost = true, it still drops below other applications when SE loses focus (the macOS NSWindowLevel.Floating caveat the helper was written for). One central change fixes Settings, Shortcuts, Word lists, Speech to Text, and any future ShowDialogAsync dialog.

This also keeps the undocked windows linked/floating with the main app — dialogs now float above them rather than dropping the linkage.

Testing

  • Builds clean (UI.csproj).
  • Manual verification of undocked-mode z-order on Windows recommended before release (I can't drive the GUI here).

🤖 Generated with Claude Code

When the video controls / audio visualizer are undocked, they float above the
main window via WindowService.KeepTopmostWhileOwnerActive (Topmost while the
owner is active). Modal dialogs shown through ShowDialogAsync used a plain
ShowDialog(owner) with no topmost handling, so they were normal (non-topmost)
windows and rendered *behind* the undocked windows. Because a modal dialog is
an owned child of the main window, the main window doesn't fire Deactivated, so
the undocked window's Topmost is never lowered and the dialog stays hidden
(clicking Apply re-asserts the same state). The Find window was unaffected
because it already joins the same topmost tier via KeepTopmostWhileOwnerActive.

Apply KeepTopmostWhileOwnerActive to dialogs in both ShowDialogAsync overloads
so they join that tier: activated last, they sit above the undocked windows,
and they still drop below other applications when SE loses focus (the macOS
NSWindowLevel.Floating caveat the helper handles). Fixes Settings, Shortcuts,
Word lists, Speech to Text and any other ShowDialogAsync dialog at once.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@niksedk niksedk merged commit 1ec75d6 into main Jun 29, 2026
1 of 3 checks passed
@niksedk niksedk deleted the fix/dialogs-behind-undocked-windows-11971 branch June 29, 2026 07:50
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.

SE 5.1.0 beta 2: Windows behind windows in undocked mode

1 participant