Commit Graph

11022 Commits

Author SHA1 Message Date
Sam Lantinga 3fae4c5c83 Updated to version 2.26.5 for release 2023-04-04 17:57:53 -07:00
Sam Lantinga 67100be3cf Fixed crash if dbus can't be initialized
(cherry picked from commit cf2c6fa58dea02edb870cff7090fd69f3dfbd081)
(cherry picked from commit 57043825ba04c1cbf729123ceed09c8e033adcbb)
2023-04-04 12:36:05 -07:00
Sam Lantinga 4fb81fdff9 Fixed analog triggers on the DualSense controller
(cherry picked from commit a67d41050164e447048fa55179cc31b23be9d9b7)
(cherry picked from commit 866f7c7f7c496343ad21d32f8edc76390e11101d)
2023-03-30 07:46:14 -07:00
Sam Lantinga d94b944f91 Added support for the trigger buttons on the Victrix Pro FS for PS5
(cherry picked from commit 8d7e61ea42364c256b76e7f6f2b6d6f90742bcb7)
(cherry picked from commit ab1670386f8716db0d3a9c5d4b69c0435b6db025)
2023-03-30 07:46:13 -07:00
Sam Lantinga 384144d632 The Xinmotek Controller is used in multiple products with different mappings
The mapping included here is for the Ultimate Atari Fight Stick

(cherry picked from commit f1099f8e70a1284c2ee3031f2ea0cfc84f22110c)
(cherry picked from commit c2ee45f5ffbba6ff6962eb24fd117586a38cce5e)
2023-03-30 07:44:44 -07:00
Pierre Wendling f84428ca01 SDL_hidapi_steam.c: Fix compilation under c2x.
When N2935 is implemented, the enum breaks compilation. Use a #define of
the SDL booleans instead.

(cherry picked from commit 975039ce0d3587c42e11f2922240957fc8f74166)
(cherry picked from commit ed5a343d25fd12c199a1e0479e65d93cd60ccf3d)
2023-03-30 07:42:30 -07:00
Frank Praznik 086322076a events: Increase the size of the name buffer when logging events
Event names have grown in length and are occasionally truncated when being logged (e.g. SDL_EVENT_WINDOW_PIXEL_SIZE_CHA). Increase the event name buffer size to handle the longer names.

(cherry picked from commit 203a2a76fc0af2094de84d75dbf959c7db73fe72)
(cherry picked from commit c0824cd49adb185d1aa992242911467dc0bf46b1)
2023-03-30 07:42:00 -07:00
Ivan Mogilko 24098b75b1 Fixed SDL_RenderSetVSync does not update flags if simulated vsync is on
This lets the user to correctly detect current vsync state by reading SDL_RendererInfo.
Also fixes SetVSync's return value check (it may be positive for error too).

(cherry picked from commit d78072fcd46943288a6007cd6f4ab1f98f446b1d)
2023-03-18 11:44:05 -07:00
Sam Lantinga 519384d3b6 Added gamepad mapping for Flydigi Vader 2 with the latest firmware (6.0.4.9)
(cherry picked from commit ed0937598e0a637a1033c90a1b31886537bb288c)
(cherry picked from commit b57a6a1adf15f9a6e4a48e1980aa723d47fa2fe3)
2023-03-18 11:43:38 -07:00
Lokathor b01194345f Make mappings for "Retrolink SNES Controller" with `SDL_GAMECONTROLLER_USE_BUTTON_LABELS` both on and off
I've only tested this on windows, but I went ahead and made the same changes for linux and mac because I assumed it's the same there and that we'd want to keep the three platforms in sync.

(cherry picked from commit b8bc4a234b93efa7a28c7fd7d524d905d9b76e6d)
(cherry picked from commit cfd6b34b8f18ac7b3ea6308c020d759e172df038)
2023-03-18 11:43:22 -07:00
Sam Lantinga 848cf421c9 Added mapping for the Xbox Elite Core controller connected via Bluetooth on Android
(cherry picked from commit d08338ddc5bb3cae1e4ce06201a2cd3c53215aa0)
(cherry picked from commit 8fc10ac95ca23359264a9a185a6b856b5d706b00)
2023-03-18 11:43:17 -07:00
divVerent 1545b233a6 Fix Xbox One gamepad axis assignment on SDL_JOYSTICK_ANDROID API (#7405)
(cherry picked from commit 6f1f586086a18ab32ddccc05e4616aac02774a1b)
(cherry picked from commit 91ad208d18d86fab25f3993f2d55794d39ead9c7)
2023-03-18 11:43:13 -07:00
Sam Lantinga 46a3a8e88f Added mapping for DualSense Edge Wireless Controller on Linux
This is a mapping when using evdev, not the more advanced HIDAPI support.

(cherry picked from commit 206fa4dafb633ed074b930cbb3440a9925c532f2)
(cherry picked from commit 715749f578f8379f192c5805ec41804e1a411bf8)
2023-03-18 11:43:07 -07:00
Sam Lantinga d8cb962f9f Sorted controller list
(cherry picked from commit 68e2f230662a0b3f2ce7c0085f781f1652901af3)
(cherry picked from commit 7285f0d441330386758f926aeb8b5be0f4486e4e)
2023-03-18 11:42:36 -07:00
Alfredo Escobar d4a9201b52 Add Hori Pokken Tournament DX Pro Pad
(cherry picked from commit 76552e4780a57f24ec1cd77fb942b7cabe1219d8)
(cherry picked from commit ca3468cb55a49baf32dcaccc85856f0682de8ec4)
2023-03-18 11:42:30 -07:00
Sam Lantinga 1f514f5e3e Sorted controller list
(cherry picked from commit 1c03ddefc320ec9969d5f81c2c3cb988d94a8b4c)
(cherry picked from commit 5b5a72e33c305c87016ab0abe34fe675cf065156)
2023-03-18 11:42:20 -07:00
Antonis Geralis 1f5c590806 Added Elecom 8button gamepad
(cherry picked from commit 52cd9fcbb074771804f443e7a9b2e9436485fe83)
(cherry picked from commit 58fa43e7c35c3180d2c0885c05faf2fe99d574f4)
2023-03-18 11:42:15 -07:00
Leonardo Brondani Schenkel fb1a01a3dd Add Linux mapping for 8BitDo Pro 2 Wired Controller for Xbox
Without these mappings, this controller "kinda" works out of the box:
- `SDL_GameControllerMapping()` works because it will notice "Xbox" in
  the name and use the default XInput mappings
- `SDL_GameControllerMappingForGUID()` will not find any mapping

lsusb:
```
ID 2dc8:2000 8BitDo 8BitDo Pro 2 Wired Controller for Xbox
```

In Linux this controller is supported by two drivers:
- `xpad` (built-in to the kernel), exposes the controller name from the
  USB descriptor and the GUID starts with 03 (0x03 = BUS_USB)
- `xone` (https://github.com/medusalix/xone), exposes a virtual
  controller which is always named "Microsoft X-Box One pad" and the
  GUID starts with 06 (0x06 = BUS_VIRTUAL)

This commit adds the 2 GUIDs from both drivers so mappings will always
be found and the real controller name will always be reported.

(cherry picked from commit 4266cf8504c08b17ef55be11c27f2fc7a17b6edf)
2023-03-18 11:42:10 -07:00
Alynne 106c0e6328 Adds Stadia BT mapping
(cherry picked from commit 4dea13e02fbfd2ac9eeb0a5cbb35cf5d1d53f549)
(cherry picked from commit 92779a5bd8feb9b446bcac9e609cf8b24fe335df)
2023-03-18 11:41:44 -07:00
Sam Lantinga 1fd1f7d565 Don't accept official mappings for controllers that aren't unique
For example, the DragonRise Inc. Generic USB Joystick
See https://github.com/gabomdq/SDL_GameControllerDB/issues/202 for details

(cherry picked from commit 673bc5764942e3f645f1ff7d64f3d6a2059e3cdb)
(cherry picked from commit c4a493de973af6053ef5085d7e67587aba1a8463)
2023-03-18 11:41:38 -07:00
Sam Lantinga 90e2e62691 Fixed sort_controllers.py and resorted game controller database
(cherry picked from commit 917607c335a87edcb3870b8504247609bea3c04d)
(cherry picked from commit 4a87abc966fc657a1b49307d50bf152b2940bcc4)
2023-03-18 11:41:31 -07:00
Sam Lantinga 3e5497777e Added gamepad mappings for the Xin-Mo Dual Arcade Fightstick
(cherry picked from commit d29e1f363239b45aedf5f81683fbb6cf52029bc2)
(cherry picked from commit 2290d71338f11ac946896101bf732d1b0b52ff13)
2023-03-18 11:41:24 -07:00
Anonymous Maarten 3cbd8823ba cmake: get_filename_component(EXT) retturns extension including leading dot 2023-03-15 14:57:08 +01:00
Sam Lantinga 2fe5f3239c Ignore the PS4 packet CRC if it's not being set correctly
This fixes handling the 8BitDo SN30 Pro with the 2.00 firmware in PS4 mode

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

(cherry picked from commit 3951cae4a56fddcb42ce4141a6518c97fa9125cd)
(cherry picked from commit 57ae9f466db41e32c67c5a9a03c28f7803ac02c9)
2023-03-13 20:00:52 -07:00
Qrox 20e17559e5 Uses integer arithmetics in SDL_ResampleAudio
- Avoids precision loss caused by large floating point numbers.
- Adds unit test to test the signal-to-noise ratio and maximum error of resampler.
- Code cleanup
2023-03-09 22:13:17 -08:00
Sam Lantinga ae5fdc0b00 Added header for SDL_Delay()
(cherry picked from commit 71dc7169d972b500170c7320742949cdebfbccdf)
2023-03-09 17:19:06 -08:00
Sam Lantinga 45167b9d13 Wait for the GCController framework to see IOKit devices
It occasionally takes a few millseconds for the GCController framework to handle the device notification and set up the device

Fixes the duplicate controller issue in https://github.com/libsdl-org/SDL/issues/6686

(cherry picked from commit 645823fc901c98b688512d3b3e70cc8922e8140c)
(cherry picked from commit 3f00fa16c656d0651c43720d8f84138ac3b998ee)
2023-03-09 16:13:48 -08:00
Sam Lantinga 596a594714 If the client rect is empty, use the last known window size
This happens on Windows 11 with fullscreen desktop windows when the desktop is brought up with the Windows+D shortcut.

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

(cherry picked from commit 2ca727aec6f5f264620f80999beb5ef77eefec4a)
(cherry picked from commit 46d143376a55817c240a58f226ca944581d414cf)
2023-03-09 10:40:53 -08:00
Ozkan Sezer 69875ad80f Removed guard around the enabled assertions support code
Otherwise, SDL_assert_always() wouldn't work.

Fixes https://github.com/libsdl-org/SDL/issues/7433
2023-03-09 20:51:50 +03:00
Deve 54ca4d3879 Fixed incorrect modifier keys handling on macOS
(cherry-picked from commit 45a58b7882a253db29b1b1393bc2a1fe030d5955)
2023-03-09 20:28:50 +03:00
Sam Lantinga 1723e93a0c Fixed handling simple mode PS4 reports
Fixes https://github.com/libsdl-org/SDL/issues/7270

(cherry picked from commit 5925cd4ef377a2211fd057ef6fa9f41141999cb7)
(cherry picked from commit 2c6995778e941524a4857b55d4e35745313c924a)
2023-03-08 12:27:00 -08:00
Sam Lantinga 07d0f51fa2 Updated to version 2.26.4 for release 2023-03-06 15:52:05 -08:00
Sam Lantinga cbc2b014b6 Don't clobber an existing entry with a different version when adding a gamepad mapping
(cherry picked from commit 727c7d4e2f44102bb571180929bfbb5d527f4f27)
(cherry picked from commit 660fc89967257cf66938fa564208984c4a45e0ff)
2023-03-01 16:46:24 -08:00
Sam Lantinga fa9f7c70c5 Fixed relative mouse motion over remote desktop
Setting the cursor clip area to a single pixel prevents the relative mouse motion remote desktop warping from working, so the mouse is never recentered.

(cherry picked from commit daffe02b117ccd484763eadc716e4d4453c89868)
(cherry picked from commit ad09976eca7c931ef468119b4a4716ec7e07560e)
2023-02-24 09:23:55 -08:00
Anonymous Maarten dc34e96fff ci: install pkg-config on Macos runner
(cherry picked from commit 86f0c694653eb1f1e91213c7faf3080a96c6375b)
2023-02-17 01:05:01 +03:00
Sam Lantinga 6edc0100e1 Fixed Steam Runtime sandbox detection
Fixes hotplug issues on Steam Deck for Proton and native games

(cherry picked from commit bcd97b36d23d08226e98a995eafd3d6aa35401b4)
(cherry picked from commit e7376b7b74026d7da041d2c848e99c9f7f4d74c0)
2023-02-15 13:55:31 -08:00
Ozkan Sezer 9b061c04e7 cmake: really fix detection of pthread_setname_np() on Apple platforms. 2023-02-13 11:56:10 +03:00
Ozkan Sezer 718a880f91 cmake: fix detection of pthread_setname_np() on Apple platforms. 2023-02-13 11:55:40 +03:00
Ozkan Sezer 853ee9a3e6 testime.c fixes from SDL2 branch. 2023-02-10 11:11:10 +03:00
Sam Lantinga adf31f6ec0 Updated to version 2.26.3 for release 2023-02-06 14:08:14 -08:00
Anonymous Maarten 20c2fa18fe cmake: assume autotools static libraries with lib prefix and .a suffix 2023-02-01 19:15:05 +01:00
Ozkan Sezer 4f94da5c53 typo fix to config.sub,
from https://lists.gnu.org/archive/html/config-patches/2023-01/msg00001.html
2023-01-21 10:15:02 +03:00
happyharryh c816300615 Fixed the hat_map to avoid segmentation fault
(cherry picked from commit 57e78f4cf53b0fc84900a047120263c3c71e721c)
(cherry picked from commit 2cb422360cef4763d16fdd1f753de55ebe858b7a)
2023-01-12 07:01:17 -08:00
Sam Lantinga ce67788629 Fixed centering the D-pad on some joysticks
Fixes https://github.com/libsdl-org/SDL/issues/6767

(cherry picked from commit d1b4810542183a415e42b11b516bf8d5b0a6d58c)
2023-01-12 07:01:17 -08:00
Sam Lantinga 05b03032f1 Updated copyright for 2023 2023-01-09 09:52:59 -08:00
Ozkan Sezer c49d02cd13 cmake (CheckPTHREAD): remove _GNU_SOURCE define after bug #7026 fix 2023-01-09 01:32:00 +03:00
Anonymous Maarten e312fbb37d cmake: do all compile tests with -D_GNU_SOURCE=1 2023-01-08 19:23:02 +01:00
Sam Lantinga 3c72e2de4d Fixed infinite loop shutting down WGI controllers
We are guaranteed that the lock will be held during shutdown, so if we are in InvokeRemoved(), it's because we're shutting down controllers and need to remove them from our internal list.

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

(cherry picked from commit ac99db9fc8d528a79abb98a5641e0fd94aa20a9e)
(cherry picked from commit ebc2fb411f178c806119b57ae3c18553d7391a13)
2023-01-08 09:36:17 -08:00
Ozkan Sezer 8e31fc4130 cmake: check for math library functions even in the absence of libm
(Reference issue: https://github.com/libsdl-org/SDL/issues/7011)
2023-01-07 14:25:04 +03:00
Ozkan Sezer 75834df37c cmake: fix detection of library functions when -Werror is enabled.
(Reference issue: https://github.com/libsdl-org/SDL/issues/7011)
2023-01-07 14:25:04 +03:00