Commit ce5763230bae4bab9e39634100cc40a7d10433ff

Sam Lantinga 2022-06-10T12:42:45

The backlight event is "change", not "add" or "remove"

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/hidapi/SDL_hidapi.c b/src/hidapi/SDL_hidapi.c
index fa8e56e..d656117 100644
--- a/src/hidapi/SDL_hidapi.c
+++ b/src/hidapi/SDL_hidapi.c
@@ -416,10 +416,7 @@ HIDAPI_UpdateDiscovery()
                     const char *action = NULL;
                     action = usyms->udev_device_get_action(pUdevDevice);
                     if (!action || SDL_strcmp(action, "add") == 0 || SDL_strcmp(action, "remove") == 0) {
-                        const char *subsystem = usyms->udev_device_get_subsystem(pUdevDevice);
-                        if (!subsystem || SDL_strcmp(subsystem, "backlight") != 0) {
-                            ++SDL_HIDAPI_discovery.m_unDeviceChangeCounter;
-                        }
+                        ++SDL_HIDAPI_discovery.m_unDeviceChangeCounter;
                     }
                     usyms->udev_device_unref(pUdevDevice);
                 }