From e66e25ff71d67975e4c5ba0df569339270cfafe2 Mon Sep 17 00:00:00 2001 From: glx22 Date: Sat, 15 May 2021 15:50:32 +0200 Subject: [PATCH] Fix #9269, f6d5c01: Hide windows without abusing WC_INVALID --- src/widgets/dropdown.cpp | 4 ++-- src/window.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index a4bd002593..e838d72315 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); diff --git a/src/window.cpp b/src/window.cpp index bb7787581a..036b17bcca 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -3489,6 +3489,6 @@ void RelocateAllWindows(int neww, int newh) */ PickerWindowBase::~PickerWindowBase() { - this->window_class = WC_INVALID; // stop the ancestor from freeing the already (to be) child + *this->z_position = nullptr; // stop the ancestor from freeing the already (to be) child ResetObjectToPlace(); }