1
0
Fork 0

Change: Limit scheduled window invalidation events to just one.

Stacking up window invalidation events does not serve much use as in all cases the data passed is the same.

When processing the events, it would then invalidate windows multiple times for no reason.
pull/11896/head
Peter Nelson 2024-01-27 14:13:46 +00:00
parent 8a4a99b7e8
commit 82872d0a29
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 3 additions and 1 deletions

View File

@ -3121,7 +3121,9 @@ void Window::InvalidateData(int data, bool gui_scope)
this->SetDirty();
if (!gui_scope) {
/* Schedule GUI-scope invalidation for next redraw. */
this->scheduled_invalidation_data.push_back(data);
if (std::find(std::begin(this->scheduled_invalidation_data), std::end(this->scheduled_invalidation_data), data) == std::end(this->scheduled_invalidation_data)) {
this->scheduled_invalidation_data.push_back(data);
}
}
this->OnInvalidateData(data, gui_scope);
}