Skip to content

Commit 5ac96e8

Browse files
authored
Refine input driver selection: enable fallback to linuxraw in more cases. (#18196)
1 parent 6c120d0 commit 5ac96e8

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

gfx/drivers_context/drm_ctx.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -938,15 +938,15 @@ static void gfx_ctx_drm_input_driver(void *data,
938938
const char *joypad_name,
939939
input_driver_t **input, void **input_data)
940940
{
941-
#ifdef HAVE_X11
942941
settings_t *settings = config_get_ptr();
943942

944-
/* We cannot use the X11 input driver for DRM/KMS */
945-
if (string_is_equal(settings->arrays.input_driver, "x"))
943+
/* We cannot use the X11 input driver for DRM/KMS, and udev may be restricted */
944+
if ( string_is_equal(settings->arrays.input_driver, "x")
945+
|| string_is_equal(settings->arrays.input_driver, "udev"))
946946
{
947947
#ifdef HAVE_UDEV
948948
{
949-
/* Try to set it to udev instead */
949+
/* Try to set it to udev */
950950
void *udev = input_driver_init_wrap(&input_udev, joypad_name);
951951
if (udev)
952952
{
@@ -958,7 +958,7 @@ static void gfx_ctx_drm_input_driver(void *data,
958958
#endif
959959
#if defined(__linux__) && !defined(ANDROID)
960960
{
961-
/* Try to set it to linuxraw instead */
961+
/* Try to set it to linuxraw if not available or failed to initialize */
962962
void *linuxraw = input_driver_init_wrap(&input_linuxraw, joypad_name);
963963
if (linuxraw)
964964
{
@@ -969,7 +969,6 @@ static void gfx_ctx_drm_input_driver(void *data,
969969
}
970970
#endif
971971
}
972-
#endif
973972

974973
*input = NULL;
975974
*input_data = NULL;

0 commit comments

Comments
 (0)