Skip to content

Commit 4b5e62d

Browse files
authored
Merge pull request #484 from pc223/fixSettingsNotShowFromMinimized
[UI] Fix `Settings-window` doesn't show back up when minimized in taskbar by user
2 parents 9fc97c6 + 18b889c commit 4b5e62d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Flow.Launcher/Helper/SingletonWindowOpener.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@ public static T Open<T>(params object[] args) where T : Window
1111
var window = Application.Current.Windows.OfType<Window>().FirstOrDefault(x => x.GetType() == typeof(T))
1212
?? (T)Activator.CreateInstance(typeof(T), args);
1313
Application.Current.MainWindow.Hide();
14+
15+
// Fix UI bug
16+
// Add `window.WindowState = WindowState.Normal`
17+
// If only use `window.Show()`, Settings-window doesn't show when minimized in taskbar
18+
// Not sure why this works tho
19+
// Probably because, when `.Show()` fails, `window.WindowState == Minimized` (not `Normal`)
20+
// https://stackoverflow.com/a/59719760/4230390
21+
window.WindowState = WindowState.Normal;
1422
window.Show();
23+
1524
window.Focus();
1625

1726
return (T)window;

0 commit comments

Comments
 (0)