Skip to content

Commit 0e7c80a

Browse files
committed
Reset quick switch when disable quick switch
1 parent 1643c49 commit 0e7c80a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Flow.Launcher.Infrastructure/QuickSwitch/QuickSwitch.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,29 @@ public static void SetupQuickSwitch(bool enabled)
176176
}
177177
else
178178
{
179+
// Remove last explorer
180+
lock (_lastExplorerViewLock)
181+
{
182+
_lastExplorerView = null;
183+
}
184+
185+
// Remove dialog window handle
186+
var dialogWindowExists = false;
187+
lock (_dialogWindowHandleLock)
188+
{
189+
if (_dialogWindowHandle != HWND.Null)
190+
{
191+
_dialogWindowHandle = HWND.Null;
192+
dialogWindowExists = true;
193+
}
194+
}
195+
196+
// Remove auto switched dialogs
197+
lock (_autoSwitchedDialogsLock)
198+
{
199+
_autoSwitchedDialogs.Clear();
200+
}
201+
179202
// Unhook events
180203
if (!_foregroundChangeHook.IsNull)
181204
{
@@ -195,6 +218,12 @@ public static void SetupQuickSwitch(bool enabled)
195218

196219
// Stop drag move timer
197220
_dragMoveTimer?.Stop();
221+
222+
// Reset quick switch window
223+
if (dialogWindowExists)
224+
{
225+
InvokeResetQuickSwitchWindow();
226+
}
198227
}
199228

200229
_enabled = enabled;

0 commit comments

Comments
 (0)