mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
InputCommon: fix default input config default device not being loaded/found
Fixes bug: https://bugs.dolphin-emu.org/issues/12744
Before e1e3db13ba
the ControllerInterface m_devices_mutex was "wrongfully" locked for the whole Initialize() call, which included the first device population refresh,
this has the unwanted (accidental) consequence of often preventing the different pads (GC Pad, Wii Contollers, ...) input configs from loading
until that mutex was released (the input config defaults loading was blocked in EmulatedController::LoadDefaults()), which meant that the devices
population would often have the time to finish adding its first device, which would then be selected as default device (by design, the first device
added to the CI is the default default device, usually the "Keyboard and Mouse" device).
After the commit mentioned above removed the unnecessary m_devices_mutex calls, the default default device would fail to load (be found)
causing the default input mappings, which are specifically written for the default default device on every platform, to not be bound to any
physical device input, breaking input on new dolphin installations (until a user tried to customize the default device manually).
Default devices are now always added synchronously to avoid the problem, and so they should in the future (I added comments and warnings to help with that)
This commit is contained in:
@ -136,6 +136,7 @@ public:
|
||||
// Use this to change the order in which devices are sorted in their list.
|
||||
// A higher priority means it will be one of the first ones (smaller index), making it more
|
||||
// likely to be index 0, which is automatically set as the default device when there isn't one.
|
||||
// Every platform should have at least one device with priority >= 0.
|
||||
virtual int GetSortPriority() const { return 0; }
|
||||
|
||||
const std::vector<Input*>& Inputs() const { return m_inputs; }
|
||||
@ -226,6 +227,7 @@ public:
|
||||
Device::Output* FindOutput(std::string_view name, const Device* def_dev) const;
|
||||
|
||||
std::vector<std::string> GetAllDeviceStrings() const;
|
||||
bool HasDefaultDevice() const;
|
||||
std::string GetDefaultDeviceString() const;
|
||||
std::shared_ptr<Device> FindDevice(const DeviceQualifier& devq) const;
|
||||
|
||||
|
Reference in New Issue
Block a user