From f4fd0ca1bb30b384c3583dfcef3d63b0b8636bb9 Mon Sep 17 00:00:00 2001 From: Ivan Ivon Date: Sun, 17 Nov 2024 17:35:12 +0200 Subject: [PATCH] Bring window to front and activate when empty or invalid timer input --- Hourglass/AppEntry.cs | 2 +- Hourglass/Windows/TimerWindow.xaml.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Hourglass/AppEntry.cs b/Hourglass/AppEntry.cs index a2077a9..93f59e5 100644 --- a/Hourglass/AppEntry.cs +++ b/Hourglass/AppEntry.cs @@ -173,7 +173,7 @@ private static void ShowNewTimerWindow(CommandLineArguments arguments, TimerStar window.Restore(arguments.GetWindowSize(), RestoreOptions.AllowMinimized); window.Show(); - if (window.WindowState != WindowState.Minimized) + if (timerStart is null || window.WindowState != WindowState.Minimized) { window.BringToFrontAndActivate(); } diff --git a/Hourglass/Windows/TimerWindow.xaml.cs b/Hourglass/Windows/TimerWindow.xaml.cs index cffb453..2ebd682 100644 --- a/Hourglass/Windows/TimerWindow.xaml.cs +++ b/Hourglass/Windows/TimerWindow.xaml.cs @@ -489,7 +489,7 @@ public void Show(TimerStart timerStart, bool remember = true) else { // Otherwise, assume the user made an error and display a validation error animation - Show(); + BringToFrontAndActivate(); SwitchToInputMode(); BeginValidationErrorAnimation(); }