Merge pull request #17754 from zoltanvb/udev_to_linuxraw_fallback

Save fallback to linuxraw driver in case of first boot.
This commit is contained in:
LibretroAdmin 2025-04-09 13:26:34 -07:00 committed by GitHub
commit 4bf8855fda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 0 deletions

View File

@ -4126,7 +4126,28 @@ static void *udev_input_init(const char *joypad_driver)
/* If using KMS and we forgot this,
* we could lock ourselves out completely. */
if (!udev->num_devices)
{
settings_t *settings = config_get_ptr();
RARCH_WARN("[udev]: Couldn't open any keyboard, mouse or touchpad. Are permissions set correctly for /dev/input/event* and /run/udev/?\n");
/* Start screen is not used nowadays, but it still gets true value only
* on first startup without config file, so it should be good to catch
* initial boots without udev devices available. */
#if defined(__linux__) && !defined(ANDROID)
if (settings->bools.menu_show_start_screen)
{
/* Force fallback to linuxraw. Driver reselection would happen even
* without overwriting input_driver setting, but that would not be saved
* as input driver auto-changes are not stored (due to interlock with
* video context driver), and on next boot user would be stuck with a
* possibly nonworking configuration.
*/
strlcpy(settings->arrays.input_driver, "linuxraw",
sizeof(settings->arrays.input_driver));
RARCH_WARN("[udev]: First boot and without input devices, forcing fallback to linuxraw.\n");
goto error;
}
#endif
}
input_keymaps_init_keyboard_lut(rarch_key_map_linux);