From b68d56d94d78b3c16dda3f744b6af902d642f75b Mon Sep 17 00:00:00 2001 From: PeterN Date: Tue, 20 Jun 2023 20:34:05 +0100 Subject: [PATCH] Fix #11043: Don't choose toolbar dropdown option if focus is lost. (#11044) Since dropdown menus now get closed if they lose focus, 'instant close' dropdowns (i.e. the toolbar dropdowns) should no longer execute their action to avoid unintended actions. --- src/widgets/dropdown.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index c2de0be6c4..5664c37d30 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -199,7 +199,10 @@ struct DropdownWindow : Window { void OnFocusLost(bool closing) override { - if (!closing) this->Close(); + if (!closing) { + this->instant_close = false; + this->Close(); + } } Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override