src/core/linux/SDL_udev.c


Log

Author Commit Date CI Message
Sam Lantinga 120c76c8 2022-01-03T09:40:00 Updated copyright for 2022
Sam Lantinga dc9de1e2 2021-11-11T07:03:30 Get the correct USB VID/PID information for /dev/input/js* devices
Mathieu Eyraud 3090812e 2021-11-11T11:27:56 Convert last SDL_IOReady()'s 2nd parameter to flags Conversion missed in https://github.com/libsdl-org/SDL/pull/4897
Sam Lantinga 40e5ce7f 2021-06-04T13:23:54 This delay is no longer needed on Steam Link hardware
Steven Noonan b15bbd4e 2021-04-22T16:11:13 SDL_udev: check for NULL return value from udev_device_get_action Signed-off-by: Steven Noonan <steven@valvesoftware.com> Signed-off-by: Sam Lantinga <slouken@libsdl.org>
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
Simon McVittie 8db3171b 2020-11-11T19:14:34 udev: Factor out SDL_EVDEV_GuessDeviceClass This works on capability bitfields that can either come from udev or from ioctls, so it is equally applicable to both udev and non-udev input device detection. Signed-off-by: Simon McVittie <smcv@collabora.com>
Sam Lantinga a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
Sam Lantinga aaec90e5 2019-09-06T08:42:54 Fixed bug 4789 - Linux accelerometers no longer available as joysticks Daniel Drake A long time ago, it was possible to play neverball on Linux using the accelerometer found in HP laptops. The kernel exposes the accelerometer as a joystick (/dev/input/jsX) as well as an evdev device (/dev/input/eventX). I guess it worked fine when SDL was using the js interface, but then stopped working here: http://hg.libsdl.org/SDL/rev/fdaeea9e7567 Looking at current code which uses udev to discover joysticks, it looks for the udev tag ID_INPUT_JOYSTICK. However udev's internal input_id logic specifically tags accelerometers as ID_INPUT_ACCELEROMETER and nothing else. This looks like a good fit for SDL_HINT_ACCELEROMETER_AS_JOYSTICK.
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Sam Lantinga cd90e2ca 2018-09-24T16:33:14 Fixed bug 4267 - linkage failure with --enable-hidapi because of missing libudev symbols Ozkan Sezer hidapi dynamic udev initial patch
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Ethan Lee 84fb4893 2017-10-10T20:22:15 Check SDL_UDEV_DYNAMIC first, then SDL_UDEV_LIBS separately
Brandon Schaefer e564da78 2017-09-29T10:15:44 revert files I didnt mean to commit!
Brandon Schaefer e27f12e0 2017-09-29T10:07:37 wayland: Fix bug 3814 -Wmissing-field-initializers
Sam Lantinga fb835f9e 2017-08-14T20:22:19 Fixed bug 2330 - Debian bug report: SDL2 X11 driver buffer overflow with large X11 file descriptor manuel.montezelo Original bug report (note that it was against 2.0.0, it might have been fixed in between): http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733015 -------------------------------------------------------- Package: libsdl2-2.0-0 Version: 2.0.0+dfsg1-3 Severity: normal Tags: patch I have occasional crashes here caused by the X11 backend of SDL2. It seems to be caused by the X11_Pending function trying to add a high number (> 1024) file descriptor to a fd_set before doing a select on it to avoid busy waiting on X11 events. This causes a buffer overflow because the file descriptor is larger (or equal) than the limit FD_SETSIZE. Attached is a possible workaround patch. Please also keep in mind that fd_set are also used in following files which may have similar problems. src/audio/bsd/SDL_bsdaudio.c src/audio/paudio/SDL_paudio.c src/audio/qsa/SDL_qsa_audio.c src/audio/sun/SDL_sunaudio.c src/joystick/linux/SDL_sysjoystick.c -------------------------------------------------------- On Tuesday 24 December 2013 00:43:13 Sven Eckelmann wrote: > I have occasional crashes here caused by the X11 backend of SDL2. It seems > to be caused by the X11_Pending function trying to add a high number (> > 1024) file descriptor to a fd_set before doing a select on it to avoid busy > waiting on X11 events. This causes a buffer overflow because the file > descriptor is larger (or equal) than the limit FD_SETSIZE. I personally experienced this problem while hacking on the python bindings package for SDL2 [1] (while doing make runtest). But it easier to reproduce in a smaller, synthetic testcase.
Philipp Wiesemann 42d02890 2017-03-04T23:05:11 Linux: Fixed error message.
Sam Lantinga 45b774e3 2017-01-01T18:33:28 Updated copyright for 2017
Sam Lantinga 1e8f074c 2016-11-29T05:34:20 Avoid conflicts with multiple versions of udev by first trying the library that is linked with the executable, if any, and then picking the one that is in the build environment. This fixes joystick detection for applications using the Steam Linux Runtime
Sam Lantinga 0d24495b 2016-11-15T01:24:58 Removed unused constants Except for SDL_bmp.c where they are historically interesting and I've left them in.
Sam Lantinga 57d01d7d 2016-11-13T22:57:41 Patch from Sylvain to fix clang warnings
Sam Lantinga 1a31bbe2 2016-10-01T13:51:56 Fixed bug 3157 - Rudimentary touchscreen support in SDL_evdev (supports Raspberry Pi) tvc I've spent the last few days implementing touchscreen support in core/linux/SDL_evdev.c. It's fairly rudimentary at the moment, as can be seen from the multiple TODO's and FIXME's littered throughout, but I'm mainly submitting this patch for review. I've tested this patch on my Raspberry Pi 2 with the official touchscreen and it works fantastically, reporting all 10 multitouch points. I'm happy to work on this further, the evdev logic also needs a bit of a cleanup I think (I may have included a few changes). But if it's good enough in its current state to be committed then I'm sure there'd be plenty of people pleased, as currently the only other framework/library that supports touchscreens on the Raspberry Pi is Kivy.
Sam Lantinga 42065e78 2016-01-02T10:10:34 Updated copyright to 2016
Philipp Wiesemann 0e45984f 2015-06-21T17:33:46 Fixed crash if initialization of EGL failed but was tried again later. The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly uninitialized data structure if loading the library first failed. A later try to use EGL then skipped initialization and assumed it was previously successful because the data structure now already existed. This led to at least one crash in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was dereferenced to make a call to eglBindAPI().
Ryan C. Gordon 71468742 2015-06-12T11:58:31 Make some string literals "const char *", not "char *" (thanks, Martin!). Fixes Bugzilla #3007.
Sam Lantinga 2c4a6ea0 2015-05-26T06:27:46 Updated the copyright year to 2015
Sam Lantinga 507157ab 2015-05-25T16:22:09 Wait for devices to finish initializing when inserted, before using them. Fixes hotplug issue with XBox 360 game controller.
Ryan C. Gordon b72938c8 2015-04-20T12:22:44 Windows: Always set the system timer resolution to 1ms by default. An existing hint lets apps that don't need the timer resolution changed avoid this, to save battery, etc, but this fixes several problems in timing, audio callbacks not firing fast enough, etc. Fixes Bugzilla #2944.
Alex Szpakowski fe6c797c 2015-04-10T23:30:31 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
Sam Lantinga 3e4a8ce1 2015-04-01T19:18:56 Fixed detecting the NVIDIA controller which shows up as both a mouse and a game controller
Edward Rudd b88ca1b4 2015-02-10T16:28:56 the last parameter of XChangeProperty is the number of elements.. and when the element format is 32.. the element is "long" so we have 5 long elements here. Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture. More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
Philipp Wiesemann b48e54aa 2015-01-26T22:00:29 Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation Jonas Kulla The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c. I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
Sam Lantinga 708a43f5 2014-12-13T13:20:19 Treat any key device as a keyboard This matches commit d325f1bbbab4 for when udev is not running
David Ludwig 70438be2 2014-12-03T10:55:23 WinRT: fixed bug whereby SDL would override an app's default orientation WinRT apps can set a default, preferred orientation via a .appxmanifest file. SDL was overriding this on app startup, and making the app use all possible orientations (landscape and portrait). Thanks to Eric Wing for the heads up on this!
Philipp Wiesemann 9c398852 2014-11-22T22:20:40 Corrected header file documentation comment.
Gabriel Jacobo 5df970a6 2014-10-16T09:41:42 [udev] Fixes #2654, ID_INPUT_KEY devices are ignored. Also added some references to udev code where these flags are set.
Sam Lantinga 89127c2d 2014-10-15T09:10:50 Fixed input device detection on systems that aren't running the udev daemon
Pierre-Loup A. Griffais 24c86b55 2014-09-11T19:24:42 [X11] Reconcile logical keyboard state with physical state on FocusIn since the window system doesn't do it for us like other platforms. This prevents sticky keys and missed keys when going in and out of focus, for example Alt would appear to stick if switching away from an SDL app with Alt-Tab and had to be pressed again. CR: Sam
Sam Lantinga 7ae52b17 2014-04-17T20:18:50 Fixed bug 2477 - [PATCH] Joysticks do not work on RHEL6/CentOS6 systems Ashley Whetter RHEL6 and CentOS6 systems still use an old version of udev (147). It wasn't until udev 148 (Yep. 1 version off!) that the input class system changed from "ID_CLASS" to "ID_INPUT_{JOYSTICK,KEYBOARD,MOUSE,etc}" (http://lwn.net/Articles/364728/). Because SDL2 looks for the ID_INPUT_X field this means that it never detects any input devices on RHEL6 systems. I've attached a patch which fixes the problem. If no input devices are detected with "ID_INPUT_X" then SDL will fallback to looking for the old style "ID_CLASS" udev field instead. Because of the "big change" between udev versions I doubt it'll ever get upgraded on RHEL6, but because RHEL7 is on the way I don't know if this patch is worth merging. Hopefully it'll help anyone out that's having this problem though.
David Ludwig 3dcb451f 2014-04-09T21:29:19 Added a README file regarding WinRT support To note, this file is currently formatted with CRLF line endings, rather than LF, to allow the file to be viewed with Notepad.
Sam Lantinga 58edac3e 2014-02-02T00:53:27 Fixed bug 2374 - Update copyright for 2014... Is it that time already??
Gabriel Jacobo f848adff 2013-11-29T10:06:08 Improve Android pause/resume behavior.
Sam Lantinga 90a219a3 2013-10-05T21:15:55 Fixed bug where a Logitech wireless keyboard with built-in mouse touchpad didn't get recongized as both devices.
Gabriel Jacobo 9ceed73d 2013-09-28T13:28:19 Raspberry Pi support (also unified UDEV and EVDEV support)