Skip to content

Commit

Permalink
Invalidate the form once per second
Browse files Browse the repository at this point in the history
  • Loading branch information
wooferzfg committed Jul 13, 2024
1 parent 82230e6 commit 124624b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/LiveSplit.View/View/TimerForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private void Init(string splitsPath = null, string layoutPath = null)
Server = new CommandServer(CurrentState);
Server.StartNamedPipe();

new System.Timers.Timer(1000) { Enabled = true }.Elapsed += RaceRefreshTimer_Elapsed;
new System.Timers.Timer(1000) { Enabled = true }.Elapsed += PerSecondTimer_Elapsed;

InitDragAndDrop();
}
Expand Down Expand Up @@ -426,8 +426,11 @@ private string GetShortenedGameAndGoal(string goal)
return goal;
}

private void RaceRefreshTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
private void PerSecondTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
// Invalidate the entire form at least once per second, to avoid parts of the form not being redrawn when necessary in some cases
InvalidationRequired = true;

if (ShouldRefreshRaces)
{
for (var i = 0; i < RacesToRefresh.Count; i++)
Expand Down

0 comments on commit 124624b

Please sign in to comment.