Input settings: Fix combobox dropdown not working on linux (#500)

This commit is contained in:
goeiecool9999 2022-11-21 13:13:19 +01:00 committed by GitHub
parent 50cdaf9a16
commit 01ce523f01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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());