From 01ce523f01f28ee655c7b005d49485651f094e42 Mon Sep 17 00:00:00 2001 From: goeiecool9999 <7033575+goeiecool9999@users.noreply.github.com> Date: Mon, 21 Nov 2022 13:13:19 +0100 Subject: [PATCH] Input settings: Fix combobox dropdown not working on linux (#500) --- src/gui/input/InputSettings2.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/input/InputSettings2.cpp b/src/gui/input/InputSettings2.cpp index 96b2734b..bc3d33e0 100644 --- a/src/gui/input/InputSettings2.cpp +++ b/src/gui/input/InputSettings2.cpp @@ -147,6 +147,15 @@ wxWindow* InputSettings2::initialize_page(size_t index) auto* profiles = new wxComboBox(page, wxID_ANY, kDefaultProfileName); sizer->Add(profiles, wxGBPosition(0, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL | wxALL | wxEXPAND, 5); +#if BOOST_OS_LINUX + // We rely on the wxEVT_COMBOBOX_DROPDOWN event to trigger filling the profile list, + // but on wxGTK the dropdown button cannot be clicked if the list is empty + // so as a quick and dirty workaround we fill the list here + wxCommandEvent tmpCmdEvt; + tmpCmdEvt.SetEventObject(profiles); + on_profile_dropdown(tmpCmdEvt); +#endif + if (emulated_controller && emulated_controller->has_profile_name()) { profiles->SetValue(emulated_controller->get_profile_name());