Skip to content

Commit 362ac27

Browse files
committed
Improve taskbar visibility management in MainViewModel
Moved taskbar show logic to after keyboard layout switch in Show(). Added logic to hide taskbar in Hide() if shown by Flow Launcher. Ensures consistent taskbar state when invoking or hiding the app.
1 parent 5be72d8 commit 362ac27

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,13 +2110,6 @@ public void Show()
21102110
// When application is exiting, we should not show the main window
21112111
if (App.LoadingOrExiting) return;
21122112

2113-
// Show the taskbar if the setting is enabled
2114-
if (Settings.ShowTaskbarWhenInvoked && !_taskbarShownByFlow)
2115-
{
2116-
Win32Helper.ShowTaskbar(isOnPrimaryScreen);
2117-
_taskbarShownByFlow = true;
2118-
}
2119-
21202113
// When application is exiting, the Application.Current will be null
21212114
Application.Current?.Dispatcher.Invoke(() =>
21222115
{
@@ -2154,6 +2147,13 @@ public void Show()
21542147
{
21552148
Win32Helper.SwitchToEnglishKeyboardLayout(true);
21562149
}
2150+
2151+
// Show the taskbar if the setting is enabled
2152+
if (Settings.ShowTaskbarWhenInvoked && !_taskbarShownByFlow)
2153+
{
2154+
Win32Helper.ShowTaskbar(isOnPrimaryScreen);
2155+
_taskbarShownByFlow = true;
2156+
}
21572157
}
21582158

21592159
public async void Hide(bool reset = true)
@@ -2222,6 +2222,7 @@ public async void Hide(bool reset = true)
22222222
Win32Helper.RestorePreviousKeyboardLayout();
22232223
}
22242224

2225+
// Hide the taskbar if the setting is enabled
22252226
if (_taskbarShownByFlow)
22262227
{
22272228
Win32Helper.HideTaskbar(isOnPrimaryScreen);

0 commit comments

Comments
 (0)