From a631bf192c78cb64e37972287e619fbe3adc90df Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Fri, 13 Oct 2023 00:32:36 +0200 Subject: [PATCH] lua: Fix dialog dropdowns that are empty by default on Mac --- src/auto4_lua_dialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/auto4_lua_dialog.cpp b/src/auto4_lua_dialog.cpp index 7b4b5fa0c..36bc35723 100644 --- a/src/auto4_lua_dialog.cpp +++ b/src/auto4_lua_dialog.cpp @@ -326,6 +326,12 @@ namespace Automation4 { { lua_getfield(L, -1, "items"); read_string_array(L, items); + +#ifdef __WXMAC__ + if (std::find(items.begin(), items.end(), value) == items.end()) { + items.insert(items.begin(), value); + } +#endif } bool CanSerialiseValue() const override { return true; }