Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update ExtLibs/Controls/BackstageView/BackstageView.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Loading branch information
MostafaElsehy and Copilot authored Mar 12, 2026
commit 4bb7b211271464fde36eabcc8675aa0c739913f0
12 changes: 8 additions & 4 deletions ExtLibs/Controls/BackstageView/BackstageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -514,15 +514,19 @@ public void ActivatePage(BackstageViewPage associatedPage)
// ---------------------------------------------------------
// FIX for Issue #3633: Pop-out window not closing when re-docking
// ---------------------------------------------------------
// If any page is currently popped out in an external window, close it
// before navigating to prevent leaving an empty "ghost" window.
if (popoutPage != null)
// If a different page is currently popped out in an external window,
// close it before navigating to prevent leaving an empty "ghost" window.
if (popoutPage != null && popoutPage != associatedPage)
{
Form parentWindow = popoutPage.Page.Parent as Form;
if (parentWindow != null)
if (parentWindow != null && !parentWindow.IsDisposed)
{
parentWindow.Close();
}

// Reset the popped-out page reference so we don't repeatedly
// attempt to close an already-closed window on subsequent navigations.
popoutPage = null;
}
// ---------------------------------------------------------

Expand Down