From 4dcec503031b37c0030f236fb51f888338366841 Mon Sep 17 00:00:00 2001 From: Daniel Chalmers Date: Sat, 2 May 2026 09:04:29 -0500 Subject: [PATCH 1/2] Keep clock timer running while minimized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a startup edge case where launching with `StartHidden` could leave the displayed clock text stale until the window was restored. Minimizing was previously treated as a reason to pause the timer, but in practice that optimization is too small to justify the risk: the app remains resident either way, and a one-second clock tick is core behavior for a desktop clock. This keeps the app’s background behavior aligned with user expectations: hidden or minimized should mean “not visible,” not “time stops updating.” --- DesktopClock/MainWindow.xaml.cs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/DesktopClock/MainWindow.xaml.cs b/DesktopClock/MainWindow.xaml.cs index 62bf00b..f7e220a 100644 --- a/DesktopClock/MainWindow.xaml.cs +++ b/DesktopClock/MainWindow.xaml.cs @@ -378,19 +378,8 @@ private void Window_SizeChanged(object sender, SizeChangedEventArgs e) private void Window_StateChanged(object sender, EventArgs e) { - if (WindowState == WindowState.Minimized) - { - // Save resources while minimized. - _systemClockTimer.Stop(); - EfficiencyModeUtilities.SetEfficiencyMode(true); - } - else - { - // Resume normal updates. - UpdateTimeString(); - _systemClockTimer.Start(); - EfficiencyModeUtilities.SetEfficiencyMode(false); - } + UpdateTimeString(); + EfficiencyModeUtilities.SetEfficiencyMode(WindowState == WindowState.Minimized); ApplyWindowVisibilitySettings(); } From 2dbcb9478fe13b878b2f143ceaabab3f2596edc4 Mon Sep 17 00:00:00 2001 From: Daniel Chalmers Date: Sat, 2 May 2026 09:10:58 -0500 Subject: [PATCH 2/2] Remove efficiency mode The efficiency gain is likely negligible for one lightweight tick per second, and removing it makes the lifecycle argument cleaner. If efficiency mode matters, bring it back as a separate, explicit feature with a name/setting that says the app may deprioritize background timing. --- DesktopClock/MainWindow.xaml.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/DesktopClock/MainWindow.xaml.cs b/DesktopClock/MainWindow.xaml.cs index f7e220a..1a7a5b9 100644 --- a/DesktopClock/MainWindow.xaml.cs +++ b/DesktopClock/MainWindow.xaml.cs @@ -12,7 +12,6 @@ using DesktopClock.Properties; using DesktopClock.Utilities; using H.NotifyIcon; -using H.NotifyIcon.EfficiencyMode; using WpfWindowPlacement; namespace DesktopClock; @@ -379,7 +378,6 @@ private void Window_SizeChanged(object sender, SizeChangedEventArgs e) private void Window_StateChanged(object sender, EventArgs e) { UpdateTimeString(); - EfficiencyModeUtilities.SetEfficiencyMode(WindowState == WindowState.Minimized); ApplyWindowVisibilitySettings(); }