From 5603857d3d38f3515294f7b15dfdafe92da646c8 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 2 Nov 2026 17:40:26 -0800
Subject: [PATCH] udev: merged performance improvements from d6fbbbe in main
---
src/core/linux/SDL_udev.c | 3 ---
src/hidapi/SDL_hidapi.c | 2 ++
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/core/linux/SDL_udev.c b/src/core/linux/SDL_udev.c
index 111e362f6c98a..107e1d6c7646c 100644
--- a/src/core/linux/SDL_udev.c
+++ b/src/core/linux/SDL_udev.c
@@ -158,9 +158,6 @@ bool SDL_UDEV_Init(void)
_this->syms.udev_monitor_filter_add_match_subsystem_devtype(_this->udev_mon, "sound", NULL);
_this->syms.udev_monitor_filter_add_match_subsystem_devtype(_this->udev_mon, "video4linux", NULL);
_this->syms.udev_monitor_enable_receiving(_this->udev_mon);
-
- // Do an initial scan of existing devices
- SDL_UDEV_Scan();
}
_this->ref_count += 1;
diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c
index dba2eef962f47..5df9ae5b2d36d 100644
--- a/src/hidapi/SDL_hidapi.c
+++ b/src/hidapi/SDL_hidapi.c
@@ -332,6 +332,8 @@ static void HIDAPI_InitializeDiscovery(void)
if (SDL_HIDAPI_discovery.m_pUdev != NULL) {
SDL_HIDAPI_discovery.m_pUdevMonitor = usyms->udev_monitor_new_from_netlink(SDL_HIDAPI_discovery.m_pUdev, "udev");
if (SDL_HIDAPI_discovery.m_pUdevMonitor != NULL) {
+ usyms->udev_monitor_filter_add_match_subsystem_devtype(SDL_HIDAPI_discovery.m_pUdevMonitor, "hidraw", NULL);
+ usyms->udev_monitor_filter_add_match_subsystem_devtype(SDL_HIDAPI_discovery.m_pUdevMonitor, "usb", NULL);
usyms->udev_monitor_enable_receiving(SDL_HIDAPI_discovery.m_pUdevMonitor);
SDL_HIDAPI_discovery.m_nUdevFd = usyms->udev_monitor_get_fd(SDL_HIDAPI_discovery.m_pUdevMonitor);
SDL_HIDAPI_discovery.m_bCanGetNotifications = true;