Skip to content

Commit e3dc615

Browse files
committed
band-aid fix for task switcher issue with minimized windows
Catches case where window is activated but not restored / maximized and then manually does that
1 parent 3e320d5 commit e3dc615

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

Flow.Launcher/PluginSettingsWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
ResizeMode="CanResize"
1212
SnapsToDevicePixels="True"
1313
StateChanged="Window_StateChanged"
14+
Activated="Window_Activated"
1415
UseLayoutRounding="True"
1516
WindowStartupLocation="CenterScreen">
1617
<WindowChrome.WindowChrome>

Flow.Launcher/PluginSettingsWindow.xaml.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ private void Window_StateChanged(object sender, EventArgs e)
9292
RefreshMaximizeRestoreButton();
9393
}
9494

95+
private void Window_Activated(object sender, EventArgs e)
96+
{
97+
98+
// Band-aid fix: Rare edge case where Alt+Tab activates the window but doesn't trigger StateChanged
99+
// So we need to restore/maximize it here if it's still minimized
100+
if (WindowState == WindowState.Minimized && _settings.SettingWindowState != WindowState.Minimized)
101+
{
102+
WindowState = _settings.SettingWindowState;
103+
}
104+
}
105+
95106
private void RefreshMaximizeRestoreButton()
96107
{
97108
if (WindowState == WindowState.Maximized)

Flow.Launcher/SettingWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
ResizeMode="CanResize"
2323
SnapsToDevicePixels="True"
2424
StateChanged="Window_StateChanged"
25+
Activated="Window_Activated"
2526
Top="{Binding SettingWindowTop, Mode=TwoWay}"
2627
UseLayoutRounding="True"
2728
WindowStartupLocation="Manual"

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ private void Window_StateChanged(object sender, EventArgs e)
101101
_settings.SettingWindowState = WindowState;
102102
}
103103
}
104+
private void Window_Activated(object sender, EventArgs e)
105+
{
106+
107+
// Band-aid fix: Rare edge case where Alt+Tab activates the window but doesn't trigger StateChanged
108+
// So we need to restore/maximize it here if it's still minimized
109+
if (WindowState == WindowState.Minimized && _settings.SettingWindowState != WindowState.Minimized)
110+
{
111+
WindowState = _settings.SettingWindowState;
112+
}
113+
}
104114

105115
private void Window_LocationChanged(object sender, EventArgs e)
106116
{

0 commit comments

Comments
 (0)