[PR #18636] Fix dialogs not working across multiple windows #31578

Open
opened 2026-01-31 09:48:09 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/18636

State: closed
Merged: Yes


This can be considered "part 1" of fixing #18599: It prevents crashes (due to unhandled exceptions) by ensuring we only create 1 content dialog across all windows at a time. Sounds bad, but I tried it and it's not actually that bad in practice (it's still really gross though).

The bad news is that I don't have a "part 2", because I can't figure out what's going on:

  • Create 2 windows
  • Open the About dialog in window 1
    and right click the text
  • Close the About dialog
  • Open the About dialog in window 2
    and right click the text
  • WinUI will simply toss the focus to window 1

It appears as if context menus are permanently associated with the first window that uses them. It has nothing to do with whether a ContentDialog instance is reused (I tested that).

Validation Steps Performed

  • Open 2 windows with 2 tabs each
  • Attempt to close window 1, dialog appears
  • Attempt to close window 2, dialog moves to window 2
**Original Pull Request:** https://github.com/microsoft/terminal/pull/18636 **State:** closed **Merged:** Yes --- This can be considered "part 1" of fixing #18599: It prevents crashes (due to unhandled exceptions) by ensuring we only create 1 content dialog across all windows at a time. Sounds bad, but I tried it and it's not actually _that_ bad in practice (it's still really gross though). The bad news is that I don't have a "part 2", because I can't figure out what's going on: * Create 2 windows * Open the About dialog in window 1 and right click the text * Close the About dialog * Open the About dialog in window 2 and right click the text * WinUI will simply toss the focus to window 1 It appears as if context menus are permanently associated with the first window that uses them. It has nothing to do with whether a ContentDialog instance is reused (I tested that). ## Validation Steps Performed * Open 2 windows with 2 tabs each * Attempt to close window 1, dialog appears ✅ * Attempt to close window 2, dialog moves to window 2 ✅
claunia added the pull-request label 2026-01-31 09:48:09 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31578