Skip to content

Commit bd11b88

Browse files
once every minute
1 parent b7bc628 commit bd11b88

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

DesktopClock/MainWindow.xaml.cs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,9 @@ private void SystemClockTimer_SecondChanged(object sender, EventArgs e)
210210
{
211211
UpdateTimeString();
212212

213-
TryPlaySound();
213+
TryShiftPixels();
214214

215-
if (Settings.Default.BurnInMitigation)
216-
{
217-
_pixelShifter ??= new();
218-
Dispatcher.Invoke(() =>
219-
{
220-
Left += _pixelShifter.ShiftX();
221-
Top += _pixelShifter.ShiftY();
222-
});
223-
}
215+
TryPlaySound();
224216
}
225217

226218
/// <summary>
@@ -276,6 +268,20 @@ private void TryPlaySound()
276268
}
277269
}
278270

271+
private void TryShiftPixels()
272+
{
273+
if (!Settings.Default.BurnInMitigation || DateTimeOffset.Now.Second != 0)
274+
return;
275+
276+
_pixelShifter ??= new();
277+
278+
Dispatcher.Invoke(() =>
279+
{
280+
Left += _pixelShifter.ShiftX();
281+
Top += _pixelShifter.ShiftY();
282+
});
283+
}
284+
279285
private void UpdateTimeString()
280286
{
281287
string GetTimeString()

0 commit comments

Comments
 (0)