1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 17:19:09 +00:00

Fix: Out-of-order window set up due to deferred window resize. (#12592)

Deferred window resize was being applied to the initial window resize event, resulting in some window state (e.g. scroll bar capacity) not being initialised when expected.
This commit is contained in:
2024-04-29 17:05:35 +01:00
committed by Peter Nelson
parent b659d3a4b4
commit 060a5c0f9f

View File

@@ -1444,7 +1444,7 @@ void Window::FindWindowPlacementAndResize(int def_width, int def_height)
if (this->resize.step_width > 1) enlarge_x -= enlarge_x % (int)this->resize.step_width; if (this->resize.step_width > 1) enlarge_x -= enlarge_x % (int)this->resize.step_width;
if (this->resize.step_height > 1) enlarge_y -= enlarge_y % (int)this->resize.step_height; if (this->resize.step_height > 1) enlarge_y -= enlarge_y % (int)this->resize.step_height;
ResizeWindow(this, enlarge_x, enlarge_y); ResizeWindow(this, enlarge_x, enlarge_y, true, false);
/* ResizeWindow() calls this->OnResize(). */ /* ResizeWindow() calls this->OnResize(). */
} else { } else {
/* Always call OnResize; that way the scrollbars and matrices get initialized. */ /* Always call OnResize; that way the scrollbars and matrices get initialized. */