mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-17 09:22:42 +01:00
Fix a4dc7249ee: Changing language or interface scale could hang. (#14087)
A bit of hysteresis caused by OnResize calling ReInit calling OnResize calling ReInit calling OnResize calling ReInit ...
This commit is contained in:
@@ -330,9 +330,9 @@ struct NetworkChatWindow : public Window {
|
||||
this->Window::Close();
|
||||
}
|
||||
|
||||
void FindWindowPlacementAndResize([[maybe_unused]] int def_width, [[maybe_unused]] int def_height) override
|
||||
void FindWindowPlacementAndResize(int, int def_height, bool allow_resize) override
|
||||
{
|
||||
Window::FindWindowPlacementAndResize(_toolbar_width, def_height);
|
||||
Window::FindWindowPlacementAndResize(_toolbar_width, def_height, allow_resize);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2216,7 +2216,7 @@ struct NetworkAskRelayWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
void FindWindowPlacementAndResize([[maybe_unused]] int def_width, [[maybe_unused]] int def_height) override
|
||||
void FindWindowPlacementAndResize(int, int, bool) override
|
||||
{
|
||||
/* Position query window over the calling window, ensuring it's within screen bounds. */
|
||||
this->left = Clamp(parent->left + (parent->width / 2) - (this->width / 2), 0, _screen.width - this->width);
|
||||
@@ -2309,7 +2309,7 @@ struct NetworkAskSurveyWindow : public Window {
|
||||
}
|
||||
}
|
||||
|
||||
void FindWindowPlacementAndResize([[maybe_unused]] int def_width, [[maybe_unused]] int def_height) override
|
||||
void FindWindowPlacementAndResize(int, int, bool) override
|
||||
{
|
||||
/* Position query window over the calling window, ensuring it's within screen bounds. */
|
||||
this->left = Clamp(parent->left + (parent->width / 2) - (this->width / 2), 0, _screen.width - this->width);
|
||||
|
||||
Reference in New Issue
Block a user