From 1e1f1fada586e4e81ef3322b0c7a7a639128a654 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 ea4bad0fcc..eeba700c86 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -203,7 +203,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