Commit Graph

16918 Commits

Author SHA1 Message Date
Anonymous Maarten
4d23eaf81e cmake: only define _FILE_OFFSET_BITS and _TIME_BITS for glibc 2023-06-29 14:55:43 +02:00
Anonymous Maarten
c3be4bc18d cmake: Compile with 64-bit time stamps where possible
On platforms where time_t is a signed 32-bit integer, most notably i386 Linux,
various functions stop working when dealing with a timestamp
beyond January 2038.

glibc has an opt-in mechanism that redefines time_t to be 64-bit,
and correspondingly increases the size of all system data
structures that contain a time_t, such as struct timeval and struct stat.
This is necessary to allow timestamps beyond January 2038 to be represented;
as well as things that obviously deal with timestamps, this affects functions
like stat(), which will fail with EOVERFLOW if asked to inspect a file whose
correct timestamp does not fit in time_t. This in turn can cause unexpected
problems for "filesystem APIs" of the form "if /run/foo exists, then ..."
when accessed by 32-bit code, if the check for existence is done with stat()
rather than access().

Using 64-bit timestamps in glibc is an opt-in and not the default, because
if done carelessly it can change libraries' ABIs. However, SDL mostly doesn't
use system headers or types in its own headers. I

Co-authored-by: Simon McVittie <smcv@collabora.com>
2023-06-28 19:47:52 -07:00
Sam Lantinga
baa9c57581 Added support for the Nintendo Online Famicom controllers 2023-06-28 19:15:43 -07:00
Simon McVittie
10fc3b3db7 evdev: Use time64-friendly accessors for struct input_event
On 32-bit platforms such as i386, if SDL is compiled with -D_TIME_BITS=64
to opt-in to ABIs that will not stop working in 2038, the fields in
this struct change their naming and interpretation.

The Linux header <linux/input.h> defines macros input_event_sec and
input_event_usec which resolve to the right struct field to look at.
The actual field names and types are an implementation detail,
historically signed 32-bit time.tv_sec and time.tv_usec on 32-bit
platforms, but becoming unsigned __sec and __usec when using 64-bit
time (which makes them able to represent times up to 2106).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-28 12:35:12 -07:00
Frank Praznik
e7327b6c73 wayland: Flush cached themes on a theme change
Flush the cached themes when the system cursor theme changes so that the stale cached value won't be used.
2023-06-28 14:53:11 -04:00
capehill
8315a00a01 Fix crash in AudioConvertByteswap 2023-06-28 14:47:10 -04:00
Frank Praznik
fd6cb4dc86 wayland: Add a DBus message handler for the cursor size and theme properties.
Add a DBus message handler to watch and respond to changes to the system cursor size and theme properties. Upon these settings being changed, a cursor refresh will be triggered so the new changes will take effect immediately, without the cursor having to leave and re-enter the window surface.
2023-06-28 13:58:05 -04:00
Sam Lantinga
e643d28d9c Set the hint value before calling hint callbacks
This allows the hint callbacks to perform more complicated logic involving multiple hints without worrying about which hint has been changed.
2023-06-28 08:53:48 -07:00
Sylvain
ad12bb4fd1 Remove hints that weren't used anymore ! 2023-06-28 06:22:20 -07:00
Anonymous Maarten
7751bfdbf3 cmake: create wiki dir before running wikiheaders.pl --copy-to-wiki 2023-06-28 14:41:31 +02:00
Sam Lantinga
0f4679102c Fixed pedantic warning: comma at end of enumerator list
Fixes https://github.com/libsdl-org/SDL/issues/7878
2023-06-27 21:52:33 -07:00
Sam Lantinga
cc5e9ffe70 Don't crash if SDL_MapRGB() and SDL_MapRGBA() are passed a NULL format 2023-06-27 16:08:19 -07:00
Sylvain
600c615529 Fixed bug #7821 - docs/README-migration.md function name typos 2023-06-27 20:10:47 +02:00
Anonymous Maarten
afdd448834 cmake: don't install sdlmanpages.cmake 2023-06-27 19:02:44 +02:00
Sam Lantinga
9ee1200e6f Fixed Nintendo Switch Pro controllers that don't have readable user calibration 2023-06-27 07:48:42 -07:00
Sam Lantinga
c065a9b128 Fix some issues caught by check_stdlib_usage.py 2023-06-27 06:19:06 -07:00
Anonymous Maarten
e8d2ccbc1c ci: reduce amount of files to copy back from freebsd vm
This should reduce the chance on an error during copy back
2023-06-27 13:59:15 +02:00
Anonymous Maarten
1061a978c3 cmake: fix header GLOB used for generating man pages 2023-06-27 13:49:50 +02:00
Sylvain
70ccf34587 Script to detect use of stdlib function 2023-06-27 04:47:08 -07:00
Anonymous Maarten
937f5d0059 cmake: allow man page installation by SDL satellite libraries
This is done by installing the wikiheaders.pl script, and add a wrapping cmake function.
2023-06-27 03:00:19 +02:00
Frank Praznik
9ab2025127 wayland: Don't initialize OpenGL when the window flags didn't specify it
Applications that don't specify a rendering flag are likely handling Vulkan/GL themselves, so SDL loading OpenGL by default in this case is unnecessary overhead, and if a render backend requires it, the window will be recreated with the appropriate flags when the renderer is initialized.
2023-06-26 13:57:48 -04:00
Narr the Reg
425062c123 hidapi: switch: Handle MCU input reports 2023-06-26 10:01:49 -07:00
Ozkan Sezer
02398a8f11 Allow building against old Linux kernels. 2023-06-26 18:01:50 +03:00
Sam Lantinga
fd062657dd Fixed build 2023-06-26 07:43:44 -07:00
meyraud705
6cc21af900 Don't keep sensor file open while sensors are disabled 2023-06-26 07:32:40 -07:00
meyraud705
9cfac88054 Improve sensor detection for Linux gamepad 2023-06-26 07:32:40 -07:00
meyraud705
000277060c Add support for sensor to joystick on Linux (evdev) 2023-06-26 07:32:40 -07:00
Sylvain
95727b5c7d use of SDL functions 2023-06-25 15:50:23 -07:00
Sam Lantinga
87e916dd21 SDL_FindFreePlayerIndex() will always return the next available player index
Fixes https://github.com/libsdl-org/SDL/issues/7868
2023-06-24 15:38:38 -07:00
Sam Lantinga
267fdd7daa Removed Bluetooth connection detection now that we get it from hidapi 2023-06-23 15:50:07 -07:00
Sam Lantinga
44bae1e8a9 Corrected the Victrix FS Pro as a PS4 controller instead of a PS3 controller 2023-06-23 14:27:21 -07:00
Sam Lantinga
6b12fbc6b7 Re-add the simpler SDL_DBus_AppendDictWithKeyValue() function 2023-06-23 07:28:05 -07:00
Sylvain
6f344f29b8 After using SDL_qsort, mark sort_entries() as SDLCALL 2023-06-23 12:52:05 +02:00
Sylvain
1827a0bf62 Remove some use of C runtime functions in testevdev 2023-06-23 11:08:08 +02:00
Sylvain
6cde3835f0 Remove some use of C runtime functions (strlen, qsort) 2023-06-23 10:51:15 +02:00
Sam Lantinga
a807b14957 Greatly improved Xbox One controller initialization sequence 2023-06-22 17:15:35 -07:00
Sylvain
8b86e3073d Revert "Android: also protect Hat/Joy/PadDown,Up so there are not sent without window"
This reverts commit 8f83ccd750.
2023-06-22 23:30:41 +02:00
Sylvain
8f83ccd750 Android: also protect Hat/Joy/PadDown,Up so there are not sent without window 2023-06-22 16:25:22 +02:00
SDL Wiki Bot
a3e0cd5208 Sync SDL3 wiki -> header 2023-06-22 13:45:16 +00:00
Sylvain
627165a2b2 Fix comments 2023-06-22 15:44:48 +02:00
Sylvain
4339113072 SDL_DBus_AppendDictWithKeyValue: allows several key/value for other PRs 2023-06-22 10:50:35 +02:00
Sam Lantinga
8aee6908bb Make sure we send update complete events for delayed guide buttons 2023-06-21 18:42:25 -07:00
Sam Lantinga
4c9fb3e169 Added the events SDL_EVENT_JOYSTICK_UPDATE_COMPLETE and SDL_EVENT_GAMEPAD_UPDATE_COMPLETE
This allows the application to tell when a joystick polling cycle is complete and can process state changes as a single atomic update. It is disabled by default, at least for now.
2023-06-21 13:59:53 -07:00
Sam Lantinga
808d83dd67 Allow specifying APP_PLATFORM and APP_ABI on the command line 2023-06-21 13:49:09 -07:00
Sam Lantinga
214d5daa3c Removed 100 ms hitch when querying third party Nintendo Switch controllers that don't respond to request for info
Also take advantage of the fact that we know whether the device is connected over Bluetooth now.
2023-06-21 12:14:50 -07:00
Sam Lantinga
3694dabe7c Use default sensor calibration if we can't read it from the Nintendo Switch controller
Fixes https://github.com/libsdl-org/SDL/issues/7830
2023-06-21 10:28:45 -07:00
Sam Lantinga
6306ee9f42 List the available haptic devices in testhaptic 2023-06-20 09:33:59 -07:00
Sam Lantinga
8cf5dc9963 Build on Android targeting the arm64-v8a architecture by default
This speeds up iteration time and covers most customer devices
2023-06-20 09:18:19 -07:00
Sam Lantinga
5f3213eb0e Added support for gamepad sensor fusion with the Razer Kishi 2023-06-20 08:41:15 -07:00
Simon McVittie
91198baed4 ibus: Handle error when getting the D-Bus machine ID
It is possible for retrieving the machine ID to fail, either because
dbus was installed incorrectly (machine ID absent or corrupt), or in
32-bit builds, because stat() on the machine ID fails with EOVERFLOW
if it has an out-of-range timestamp or inode number.

dbus has historically treated this as a faulty installation, raising
a warning which by default causes the process to crash. Unfortunately,
dbus_get_local_machine_id() never had a way to report errors, so it has
no alternative for that (bad) error handling.

In dbus >= 1.12.0, we can use dbus_try_get_local_machine_id() to get
the same information, but with the ability to cope gracefully with
errors. ibus won't work in this situation, but that's better than
crashing.

Mitigates: https://github.com/ValveSoftware/steam-for-linux/issues/9605
Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-20 06:46:33 -07:00