diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 6d1ed9c27d..f6e50e5ad2 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -339,7 +339,7 @@ struct DropdownWindow : Window { */ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button, Rect wi_rect, Colours wi_colour, bool instant_close) { - CloseWindowById(WC_DROPDOWN_MENU, 0); + CloseWindowByClass(WC_DROPDOWN_MENU); /* The preferred position is just below the dropdown calling widget */ int top = w->top + wi_rect.bottom + 1; diff --git a/src/window.cpp b/src/window.cpp index 997491d8aa..927861d742 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -3483,7 +3483,7 @@ void ChangeVehicleViewports(VehicleID from_index, VehicleID to_index) */ void RelocateAllWindows(int neww, int newh) { - CloseWindowById(WC_DROPDOWN_MENU, 0); + CloseWindowByClass(WC_DROPDOWN_MENU); for (Window *w : Window::Iterate()) { int left, top;