Fix #11894: Defer window OnResize event to avoid processing multiple times per input tick. (#11900)

This commit is contained in:
Peter Nelson
2024-01-27 18:44:27 +00:00
committed by GitHub
parent 8c5ad1ade7
commit d3c673e20b
2 changed files with 28 additions and 4 deletions

View File

@@ -274,6 +274,7 @@ protected:
virtual void FindWindowPlacementAndResize(int def_width, int def_height);
std::vector<int> scheduled_invalidation_data; ///< Data of scheduled OnInvalidateData() calls.
bool scheduled_resize; ///< Set if window has been resized.
/* Protected to prevent deletion anywhere outside Window::DeleteClosedWindows(). */
virtual ~Window();
@@ -559,6 +560,8 @@ public:
void SetShaded(bool make_shaded);
void ScheduleResize();
void ProcessScheduledResize();
void InvalidateData(int data = 0, bool gui_scope = true);
void ProcessScheduledInvalidations();
void ProcessHighlightedInvalidations();