summaryrefslogtreecommitdiff
path: root/src/widgets
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2021-05-15 15:50:32 +0200
committerLoïc Guilloux <glx22@users.noreply.github.com>2021-05-15 21:08:49 +0200
commite66e25ff71d67975e4c5ba0df569339270cfafe2 (patch)
tree84521ba9a4eec6455d84abdda1b3c4867060d41e /src/widgets
parent2e43f918913e79ea402173f63b692b609a59de09 (diff)
downloadopenttd-e66e25ff71d67975e4c5ba0df569339270cfafe2.tar.xz
Fix #9269, f6d5c01: Hide windows without abusing WC_INVALID
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dropdown.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp
index a4bd00259..e838d7231 100644
--- a/src/widgets/dropdown.cpp
+++ b/src/widgets/dropdown.cpp
@@ -188,7 +188,7 @@ struct DropdownWindow : Window {
{
/* Make the dropdown "invisible", so it doesn't affect new window placement.
* Also mark it dirty in case the callback deals with the screen. (e.g. screenshots). */
- this->window_class = WC_INVALID;
+ *this->z_position = nullptr;
this->SetDirty();
Window *w2 = FindWindowById(this->parent_wnd_class, this->parent_wnd_num);
@@ -304,7 +304,7 @@ struct DropdownWindow : Window {
if (this->click_delay != 0 && --this->click_delay == 0) {
/* Make the dropdown "invisible", so it doesn't affect new window placement.
* Also mark it dirty in case the callback deals with the screen. (e.g. screenshots). */
- this->window_class = WC_INVALID;
+ *this->z_position = nullptr;
this->SetDirty();
w2->OnDropdownSelect(this->parent_button, this->selected_index);