Changeset - r27623:94a2107d67c7
[Not reviewed]
master
0 1 0
PeterN - 12 months ago 2023-06-20 19:34:05
peter1138@openttd.org
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.
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/widgets/dropdown.cpp
Show inline comments
 
@@ -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
0 comments (0 inline, 0 general)