From 7a3431e56b1d5e01eea47fe9a4456941502e9332 Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Tue, 17 Mar 2026 21:28:35 +0100 Subject: [PATCH] Close app preset menu when main window loses focus --- Scripts/GUI/Show-MainWindow.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Scripts/GUI/Show-MainWindow.ps1 b/Scripts/GUI/Show-MainWindow.ps1 index f2fcf64..035f906 100644 --- a/Scripts/GUI/Show-MainWindow.ps1 +++ b/Scripts/GUI/Show-MainWindow.ps1 @@ -919,6 +919,11 @@ function Show-MainWindow { } }) + # Close the preset menu when the main window loses focus (e.g., user switches to another app). + $window.Add_Deactivated({ + if ($presetsPopup.IsOpen) { $presetsPopup.IsOpen = $false } + }) + # Toggle popup on button click $presetsBtn.Add_Click({ $presetsPopup.IsOpen = -not $presetsPopup.IsOpen