Commit Graph

12114 Commits

Author SHA1 Message Date
Max Maisel
c084e647ed Drain HIDAPI buffer in SDL_hidapi_steamdeck.c.
Add a loop around SDL_hid_read() in the Steam Deck HIDAPI driver as it
is done in other HIDAPI drivers. This loop reads data from the device and
processes it until the input buffer is empty which ensures that clients
always get the latest data.

This fixes an input latency issue if the application polls the events
slower than the hardware generates them.

(cherry picked from commit 22770e6496)
2024-07-05 08:29:01 -07:00
Sam Lantinga
2cdb419a21 Try to create an accelerated renderer for the window surface even if SDL_HINT_RENDER_DRIVER is "software"
This case is properly handled inside SDL_CreateWindowTexture()

Fixes https://github.com/libsdl-org/SDL/issues/10155

(cherry picked from commit c7ed78a9ef)
(cherry picked from commit a4cbba1276)
2024-07-05 08:23:39 -07:00
Sam Lantinga
2eef7ca475 Updated to version 2.30.5 for release release-2.30.5 2024-07-03 14:21:42 -07:00
Sam Lantinga
d126e7bbba Added support for the ROG RAIKIRI
(cherry picked from commit a04596c9a7)
(cherry picked from commit 845ebbbe96)
2024-07-03 13:54:52 -07:00
Sam Lantinga
e5024fae3d If a mapping specifies a crc, don't match for controllers that don't have that CRC
The CRC is used to distinguish between different controllers that have the same VID/PID, so if the CRC doesn't match, it's probably a different controller that we don't know about.

Fixes https://github.com/libsdl-org/SDL/issues/9265

(cherry picked from commit 30e93b40c2)
(cherry picked from commit b8daf14fe5)
2024-07-03 13:25:13 -07:00
Ryan C. Gordon
eb053c7f3f SDL_JoystickEventState: Make documentation and implementation match.
This changes the `SDL_EVENTS_DISABLED` path's return value from SDL_DISABLE
to SDL_IGNORE to match expectations, but doesn't actually change the ABI,
since these two symbols are both zero.

Fixes https://github.com/libsdl-org/sdlwiki/issues/460

(cherry picked from commit 7d60ff9965)
2024-07-03 13:24:19 -07:00
Sam Lantinga
ed441c8289 Turn HIDAPI joystick support off by default on mobile platforms
On Android, HIDAPI prompts for permissions and acquires exclusive access to the device, and on Apple mobile platforms it doesn't do anything except for handling Bluetooth Steam Controllers.

Fixes https://github.com/libsdl-org/SDL/issues/9241

(cherry picked from commit e3cf2e4794)
(cherry picked from commit 66054a6515)
2024-07-03 13:23:04 -07:00
Wouter Wijsman
59b0a1dc65 PSP: send initial SDL_JOYDEVICEADDED event
(cherry picked from commit 5d80179954)
2024-07-03 13:22:03 -07:00
Sam Lantinga
80d36aba5b Only use the default gamepad mapping if an automatic mapping isn't available
Fixes https://github.com/libsdl-org/SDL/issues/10162

(cherry picked from commit 0f8054cf87)
(cherry picked from commit cd8ea5e3f1)
2024-07-03 11:47:46 -07:00
Sam Lantinga
e1e36d213b Fixed build
(cherry picked from commit 288aea3b40)
2024-06-29 11:22:48 -07:00
Sam Lantinga
5c8d92e4d0 Respect SDL_HINT_RENDER_DRIVER when creating an accelerated window surface
Fixes https://github.com/libsdl-org/SDL/issues/10061

(cherry picked from commit 2a58e7b11c)
(cherry picked from commit 0d9e54237c)
2024-06-29 11:13:50 -07:00
Sam Lantinga
8a39054b54 Clean up any renderer in SDL_DestroyWindowSurface()
Also added an automated test to verify window surface functionality.

Fixes https://github.com/libsdl-org/SDL/issues/10133

(cherry picked from commit a522bfe3f1)
(cherry picked from commit a3f0c373d3)
2024-06-29 11:13:36 -07:00
1F616EMO
c60e2704c8 Remove the inconsistent and lag-causing usleep call in SDL_fcitx.c
(cherry picked from commit 3bf2b90da0)
2024-06-29 00:09:34 -07:00
Sam Lantinga
a9fdbf7f21 Make sure we don't try to use the XInput DLL after it's unloaded
Steam ran into a crash SDL_XINPUT_JoystickDetect() with XINPUTGETCAPABILITIES being NULL. I'm not sure how that happened, and there may still be a race condition if this is a multi-threaded issue, but at least this is more correct.

(cherry picked from commit 0ae4fd0ec9)
(cherry picked from commit ee3b2b7de1)
2024-06-26 15:56:21 -07:00
Sam Lantinga
ed86b02df8 Fixed building with older libdrm headers
(cherry picked from commit 8949de3978)
(cherry picked from commit 88bbab275f)
2024-06-26 15:56:20 -07:00
Sam Lantinga
0811b4dc51 Fixed building with the steamrt/scout SDK
(cherry picked from commit 4b82bed259)
(cherry picked from commit ecde0ca6b6)
2024-06-26 15:56:20 -07:00
Sam Lantinga
d9901e0b85 Fix building with the steamrt/scout SDK
(cherry picked from commit b552f26e6a)
(cherry picked from commit 64d4baccb5)
2024-06-26 15:56:20 -07:00
Frank Praznik
0f5752b0fc video: Fix memory leak when deleting a video display
The display deletion code would not free the driver data or name if the display index was the last, or only one, in the list.

(cherry picked from commit 20f1061cc8)
2024-06-26 12:32:07 -04:00
Frank Praznik
31f77182d0 wayland: Fix double free when deleting an output display
(cherry picked from commit 3b88d4f46f)
2024-06-26 12:31:51 -04:00
Cecill Etheredge
620e875335 fix: Use drmModeAddFB2WithModifiers instead of drmModeAddFB to allow using GBM modifiers.
This fixes corrupt framebuffers on platforms that require the use of modifiers.
2024-06-25 14:20:36 -07:00
Edoardo Lolletti
c18173c260 Fix std::thread memory leak
In the stdcpp thread implementation, the allocated std::thread objects were never deleted after joining/detaching

(cherry picked from commit 20dbe90771)
(cherry picked from commit 99d7b9e626)
2024-06-24 11:51:40 -07:00
Ganael Laplanche
f08f458896 Fix joystick (/dev/input/xxx) support on FreeBSD
Backport f8ad4abe from main branch.

When switching to CMake, src/joystick/linux/SDL_sysjoystick.c file got
excluded from FreeBSD builds, losing support for /dev/input/xxx devices.

See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279907
and: https://github.com/libsdl-org/SDL/pull/10087

(cherry picked from commit ab5740bde2)
2024-06-23 00:07:35 -07:00
Blaž Tomažič
53cf48f505 android: add an option to manually pass the context when loading a native library
(cherry picked from commit b444e656cd)
2024-06-20 10:40:05 -07:00
Blaž Tomažič
c32a1a5023 android: actually use ReLinker
When loading libraries the `SDL.mContext` is still `null`. This results in
relinker code path in `SDL.loadLibrary(...)` always throwing a null exception
and fallbacking to system loader.

Fix it by passing the context explicitly.

(cherry picked from commit 6a2dd96ac7)
2024-06-20 09:35:58 -07:00
expikr
8b204815cc Add SDL_MOUSE_RELATIVE_CURSOR_VISIBLE (#7947)
(cherry picked from commit ee559d51be)
(cherry picked from commit 194d72bb29)
2024-06-20 09:32:27 -07:00
Aikawa Yataro
a9bb92b3ae Update qsort implementation
(cherry picked from commit 0fe9f5da54)
(cherry picked from commit 4800edfa0c)
2024-06-19 05:50:00 +03:00
Sam Lantinga
630272eb55 Fixed requesting USB permission on Android 14 (thanks @ikhoeyZX!)
Fixes https://github.com/libsdl-org/SDL/issues/9831

(cherry picked from commit 8ab1ffca8a)
(cherry picked from commit 5a26b26880)
2024-06-17 15:12:05 -07:00
Sam Lantinga
92fe3b19c8 Updated to version 2.30.4 for release release-2.30.4 2024-06-17 12:32:13 -07:00
Sam Lantinga
30e2b03a65 Pass through the original name used by the Steam Virtual Gamepad
Proton uses this on Linux to determine what the XInput slot is for the gamepad. Other applications will get the real controller name and VID/PID by virtue of the code in SDL_steam_virtual_gamepad.c

(cherry picked from commit 361cae0874)
(cherry picked from commit a6fdd155fb)
2024-06-17 12:15:18 -07:00
Miku AuahDark
f8943854fd Android: Use SCREEN_ORIENTATION_FULL_USER instead of SCREEN_ORIENTATION_FULL_SENSOR for resizable window.
The former will respect user orientation lock setting while the latter does not.

(cherry picked from commit 3373667faa)
(cherry picked from commit 77285b6c3f)
2024-06-17 09:55:23 -07:00
Ozkan Sezer
325465935d SDL_events.c: remove long long casts an the override of SDL_PRIs64
(cherry picked from commit a4d240d295)
2024-06-14 21:37:24 +03:00
Ozkan Sezer
1cdd37b32c always define PRI?64 using 'I64' when targeting windows
avoids -Wformat warnings from mingw toolchains -- e.g.:
src/test/SDL_test_harness.c:581:37: warning: unknown conversion type character 'l' in format [-Wformat=]

(cherry picked from commit 49b6c24722)
(cherry picked from commit 863670c0a8)
2024-06-14 21:37:10 +03:00
Ozkan Sezer
499bff9c3a SDL_qsort.c: fix calling conventions of private functions' compare args 2024-06-14 14:50:10 +03:00
Sam Lantinga
bd06e43b87 Re-enable full controller reports for Joy-Con controllers
When they are in simple report mode, the thumbstick gets turned into a digital hat, so let's use them in full report mode.

(cherry picked from commit bf27269952)
(cherry picked from commit 169f77ed5e)
2024-06-13 00:02:52 -07:00
Sam Lantinga
72e5620202 Try to guess the type of a Nintendo Switch controller if we can't read the device info
(cherry picked from commit 6619de8f24)
(cherry picked from commit 6b9bf71133)
2024-06-13 00:02:52 -07:00
Sam Lantinga
fbb9646806 Ignore spurious reply packets when reading Nintendo Switch controller reports
(cherry picked from commit 5ee9a840b1)
(cherry picked from commit f1b19aa744)
2024-06-13 00:02:52 -07:00
Sam Lantinga
4b91f0793c Fixed build
(cherry picked from commit 2e8bd8f1f3)
2024-06-07 09:14:33 -07:00
Fabrice Desclaux
6243a80b3f Fix spurious LCtrl on RAlt key pressed
(cherry picked from commit 22c14442e2)
2024-06-07 08:46:29 -07:00
Oleg
e0b0a98c8e Added VRS DirectForce Pro wheelbase VID/PID to wheel devices list
(cherry picked from commit 7529b4bed5)
(cherry picked from commit 0f9191a643)
2024-06-06 09:55:35 -07:00
Frank Praznik
785eac863b wayland: Set the initial min/max limits on non-libdecor windows during a show operation
Libdecor windows will have this done during the first frame configure, but bare xdg-toplevel windows need it set explicitly, or a non-resizable window might be able to be resized.

(cherry picked from commit fc6bbde525)
2024-06-06 09:52:08 -04:00
Sam Lantinga
ab8659922d Fixed PlayStation detection interrupting input for the Logitech K400 keyboard
Also added the Logitech Chillstream to the list of PS3 controllers and fixed the right shoulder axis.

(cherry picked from commit b6d7adfec1)
(cherry picked from commit f520062ad1)
2024-06-05 19:30:10 -07:00
Sam Lantinga
d48f9c4af4 Added support for the Saitek Cyborg V.3 Rumble Pad in PS3 mode
(cherry picked from commit b6ca360228)
(cherry picked from commit e2f597de84)
2024-06-05 19:30:07 -07:00
Sam Lantinga
5cc0644aa0 Added support for the Razer Kitsune in PS5 mode
(cherry picked from commit e3beaa1972)
(cherry picked from commit 35d719ef25)
2024-05-31 15:19:13 -07:00
mechakotik
91accc391d android: Default to custom theme in styles.xml
Custom theme file exists in project, but is not used by app, which is kinda unintuitive. Using it by default so people who not familiar with Android development won't spend lots of time troubleshooting.

(cherry picked from commit 8f88c32ca6)
(cherry picked from commit 1568501dd6)
2024-05-31 11:33:17 -07:00
Anonymous Maarten
3ee20388c5 autotools needs to check d3d12sdklayers.h too
(cherry picked from commit 5e876db89f)
2024-05-28 17:02:49 +02:00
Ozkan Sezer
2449510673 Makefile.in: add VisualC-GDK to SRC_DIST
Fixes https://github.com/libsdl-org/SDL/issues/9913

(cherry picked from commit 0439fc6007)
2024-05-28 14:10:28 +03:00
Ozkan Sezer
2c07ed320e SDL_config_os2.h: remove duplicated HAVE_WCSL* defines.
(cherry picked from commit 6825a4aabb)
2024-05-28 08:01:04 +03:00
Sam Lantinga
607f37dafd Fixed compiling SDL_platform_defines.h on macOS with older compilers (thanks @sezero!)
Fixes #9632

(cherry picked from commit 36015ad5e5)
(cherry picked from commit 8bc47dc3f1)
2024-05-27 14:39:22 -07:00
Anonymous Maarten
acc2e040ce VC+d3d12: use __has_include to detect presence of d3d12 headers
backport of 4fa5006247

(cherry picked from commit 6c29778826)
2024-05-27 02:43:59 +02:00
Anonymous Maarten
faa9bbdc8e cmake: direct3d12 renderer needs d3d12.h and d3d12sdklayers.h
Older MinGW releases don't ship d3d12sdklayers.h

backport of 3af4f120d0

(cherry picked from commit 6c10201e58)
2024-05-27 02:43:29 +02:00