Commit Graph

11438 Commits

Author SHA1 Message Date
Sam Lantinga
57ae9f466d 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)
2023-03-13 20:00:19 -07:00
Rudolf Polzer
dca3fd8307 Android: indicate gamepaddb entries where axis order changed.
Axis order was changed in 6f1f586086a18ab32ddccc05e4616aac02774a1b to improve
default mappings.

(cherry picked from commit de3909a190f6e1a3f11776ce42927f99b0381675)
2023-03-11 13:01:50 -08:00
Sam Lantinga
ab1670386f Added support for the trigger buttons on the Victrix Pro FS for PS5
(cherry picked from commit 8d7e61ea42364c256b76e7f6f2b6d6f90742bcb7)
2023-03-10 15:46:22 -08:00
Sam Lantinga
76e9d64b36 Removed space between sizeof and parentheses 2023-03-10 08:13:51 -08:00
Sam Lantinga
e9f9cb29fc Fixed build warning on Android
(cherry picked from commit 2af6f4a3e4f0a82ccbb7ce142c914b5aa5df2000)
2023-03-10 08:12:28 -08:00
Stephen Kitt
3e1d7e6a14 Specify bash for androidbuildlibs.sh
This script relies on string indexes in parameter expansions, which
aren't suppored by /bin/sh (e.g. dash).

Based on a patch by Roflcopter4:
https://github.com/joncampbell123/dosbox-x/pull/3850

Signed-off-by: Stephen Kitt <steve@sk2.org>
(cherry picked from commit bbfd5b3fb2eed8f95919febf3bc0fec4bc605cbe)
2023-03-10 07:38:28 -08:00
Qrox
ef347776c2 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

(cherry-picked from commit 20e17559e545c5d3cfe86c1c4772365e70090779)
2023-03-10 18:37:00 +03:00
Ozkan Sezer
5e35309913 fix bad merge of sizeof style patch 2023-03-10 08:32:24 +03:00
Sam Lantinga
71dc7169d9 Added header for SDL_Delay() 2023-03-09 17:18:40 -08:00
Sam Lantinga
1e6ffc6294 Removed a duplicate delay accidentally added during code refactor
(cherry picked from commit 926db1bd544364a9e4ab61e60bcfbe75e05adf56)
2023-03-09 16:13:19 -08:00
Sam Lantinga
3f00fa16c6 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)
2023-03-09 16:13:19 -08:00
Sam Lantinga
0d76380042 Code style: changed "sizeof foo" to "sizeof(foo)" (thanks @sezero!)
(cherry picked from commit c6443d86c92e962683a1efe5f123a144988875b5)
2023-03-09 15:23:59 -08:00
Sam Lantinga
46d143376a 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)
2023-03-09 10:39:43 -08:00
Ozkan Sezer
22de91a947 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
1c2f825230 Fixed incorrect modifier keys handling on macOS
(cherry-picked from commit 45a58b7882a253db29b1b1393bc2a1fe030d5955)
2023-03-09 20:28:51 +03:00
Sam Lantinga
d9c07d9ef7 Fixed the documentation for SDL_SetRelativeMouseMode()
(cherry picked from commit fb0c3197e0e4696551822815bdce0e187a0b06fc)
2023-03-08 22:33:23 -08:00
Frank Praznik
8f7427c158 tests: Always set valid dimensions for the fullscreen mode 2023-03-08 19:46:37 -05:00
Frank Praznik
6a999d16fa wayland: Always use a scale factor of 1 for exclusive fullscreen emulation 2023-03-08 19:46:37 -05:00
Lokathor
cfd6b34b8f 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)
2023-03-08 16:44:30 -08:00
Ozkan Sezer
a70964aaf4 fix SDL_FindFreePlayerIndex so it can really return -1. 2023-03-08 20:00:50 +03:00
Sam Lantinga
35c13196f0 Fixed uninitialized variable 2023-03-08 08:40:38 -08:00
Ozkan Sezer
bc87983310 tests: added -DHAVE_SIGNAL_H to CFLAGS in watcom makefiles 2023-03-08 18:56:50 +03:00
Sam Lantinga
f5c0760c6b Disassociate the SDLOpenGLContext from the view before deleting it
If we don't do this, the view will be blanked even if another context is current and rendering from that context won't be visible.

Fixes https://github.com/libsdl-org/SDL/issues/4986
2023-03-08 01:15:21 -08:00
Sam Lantinga
63e6c19b7d Use SDL_GL_DeleteContext instead of Cocoa_GL_DeleteContext for context cleanup
That will make the current context NULL before deleting the context.
2023-03-08 01:13:00 -08:00
Sam Lantinga
1bd9ebf533 If we're not the current fullscreen window and we don't want to be fullscreen, don't touch the current video mode
Fixes an assertion in qemu on macOS, which creates multiple hidden windows:
2023-03-07 09:56:55.304 qemu-system-i386[9931:2984587] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'NSWindowStyleMaskFullScreen cleared on a window outside of a full screen transition. Called from (
	0   AppKit                              0x00000001968f77ac __25-[NSWindow setStyleMask:]_block_invoke + 140
	1   AppKit                              0x00000001968f76cc NSPerformVisuallyAtomicChange + 108
	2   AppKit                              0x00000001968f7580 -[NSWindow setStyleMask:] + 188
	3   libSDL2-2.0.0.dylib                 0x0000000106531328 Cocoa_SetWindowFullscreen + 568
	4   libSDL2-2.0.0.dylib                 0x0000000106501700 SDL_UpdateFullscreenMode + 1316
	5   libSDL2-2.0.0.dylib                 0x0000000106504270 SDL_SetWindowFullscreen_REAL + 328
	6   libSDL2-2.0.0.dylib                 0x000000010650117c SDL_FinishWindowCreation + 100
	7   libSDL2-2.0.0.dylib                 0x0000000106500998 SDL_CreateWindow_REAL + 1812
	8   libSDL2-2.0.0.dylib                 0x00000001063efd54 SDL_CreateWindow + 76
	9   qemu-system-i386                    0x00000001050aa600 sdl2_window_create + 192
	10  qemu-system-i386                    0x00000001050a9fa0 sdl2_2d_switch + 196
	11  qemu-system-i386                    0x0000000104e9c784 displaychangelistener_display_console + 524
	12  qemu-system-i386                    0x0000000104e9e36c register_displaychangelistener + 264
	13  qemu-system-i386                    0x00000001050ab6d0 sdl2_display_init + 304
	14  qemu-system-i386                    0x000000010505c870 qemu_init + 13380
2023-03-07 10:10:43 -08:00
Sam Lantinga
e0e79419b6 Fixed which window we check flags for when updating fullscreen mode 2023-03-07 10:08:55 -08:00
Sam Lantinga
8fc10ac95c Added mapping for the Xbox Elite Core controller connected via Bluetooth on Android
(cherry picked from commit d08338ddc5bb3cae1e4ce06201a2cd3c53215aa0)
2023-03-06 15:37:52 -08:00
divVerent
91ad208d18 Fix Xbox One gamepad axis assignment on SDL_JOYSTICK_ANDROID API (#7405)
(cherry picked from commit 6f1f586086a18ab32ddccc05e4616aac02774a1b)
2023-03-06 15:37:41 -08:00
Anonymous Maarten
6c495a92f0 cmake: use compatible interface properties to disallow linking to a different version of SDL 2023-03-03 23:41:18 +01:00
Michal Suchanek
96a2a6b945 evdev_kbd: Use current keymap
keymap can change over time, caching the keymap causes wrong keys
returned when user changes keymap during runtime

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2023-03-03 14:30:02 -08:00
Ozkan Sezer
fd4bb4154b dynapi: replace uses of deprecated SDL_assert_state and SDL_assert_data 2023-03-03 03:01:02 +03:00
Ryan C. Gordon
46945354cc
dataqueue: Make thread safe.
Each data queue gets its own mutex and each function obtains it.

Fixes #7390.

(cherry picked from commit 8b9a9384132e39a49a14cf41b292018ce4f4f251)
2023-03-02 16:43:44 -05:00
Ryan C. Gordon
f5bb286b76
dataqueue: Removed non-public SDL_ReserveSpaceInDataQueue function
This wasn't used, and it was just asking for trouble.

(cherry picked from commit f833e005e10f63979fd545d8bc29b4f1a7c36486)
2023-03-02 16:41:58 -05:00
Sam Lantinga
f47a08ab84 Fixed typo in previous cherry-pick 2023-03-01 16:47:48 -08:00
Sam Lantinga
660fc89967 Don't clobber an existing entry with a different version when adding a gamepad mapping
(cherry picked from commit 727c7d4e2f44102bb571180929bfbb5d527f4f27)
2023-03-01 16:41:44 -08:00
Sam Lantinga
6ff3e49b6f Follow the same pattern for releasing the window data in the UIKit driver
Possible fix for https://github.com/libsdl-org/SDL/issues/7361

(cherry picked from commit ebdb32065163b8ee1ef9c1a0dfa601335b4ad83d)
2023-02-28 16:15:01 -08:00
Ryan C. Gordon
e58a8639e3
docs: Removed bogus file from wiki bridge.
That was fixed to not do that again by 7e429a13d3
2023-02-28 13:40:35 -05:00
Ryan C. Gordon
5b7b3da701
Sync wiki -> headers. 2023-02-28 12:56:01 -05:00
Ryan C. Gordon
0a0dfdb2f9
wikiheaders: Sort pages before listing them in README/FrontPage.md.
(cherry picked from commit 99c38268cd1325bb64739217adbeebaae7ae6a84)
2023-02-28 12:29:21 -05:00
Ryan C. Gordon
8572e19327
wikiheaders: Use Windows endlines in the source, Unix in the wiki.
(cherry picked from commit 7745c9b3ae3f2f47e2b3e55399afc5e7b86c0102)
2023-02-28 12:29:16 -05:00
Sam Lantinga
031348d377 Fixed SDL windows getting the maximized state after leaving fullscreen on macOS
(cherry picked from commit 2df08fb1b27b721998a1380a2acdbe1494b5591e)
2023-02-28 09:03:10 -08:00
Ryan C. Gordon
462d95ab4d
wikiheaders: ignore wiki's README/FrontPage.md
(cherry picked from commit 6d1e14b7924e45937941a64bcaf751e17b41a8e9)
2023-02-28 11:56:20 -05:00
Ryan C. Gordon
a48bb80ea0
wikiheaders: Bridge README files in the docs directory to wiki.
Fixes #6026.

(cherry picked from commit 2506676f34dc9d3e64ab7bbd9c947b8c13364913)
2023-02-28 11:46:46 -05:00
Sam Lantinga
c0fb092425 Fixed locking up the Logitech F310 with the PlayStation controller detection
(cherry picked from commit da134a30396e12786c14fe8d1190ab05c67d9dba)
2023-02-28 08:37:18 -08:00
Ryan C. Gordon
37de5d4849
wikiheaders: fixed wikilinks in Markdown code sections.
(cherry picked from commit a4796334550da0963ed957829f41b9499a472d73)
2023-02-27 23:08:55 -05:00
Sam Lantinga
715749f578 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)
2023-02-27 15:21:04 -08:00
David Carlier
0c7346ec3e USE_DEV_RANDOM close the file descriptor even in the rare case it can't read it 2023-02-26 14:00:32 +03:00
Torge Matthies
711a458be5 x11: Fix duplicate Xinput2 event reception
Passing True for owner_events in the XGrabPointer call makes all
XI_RawMotion events appear in the queue twice, with the only difference
between them being the value of XGenericEventCookie::cookie. These have
always been filtered out by a check in the XI_RawMotion handler,
however with a mouse that polls at more than 1 kHz frequency, there
also exist legitimate events that appear indistinguishable from these
duplicated events. These must not be filtered out, otherwise the
pointer may move at an inconsistent speed, appearing like a bad pointer
acceleration implementation.

Change owner_events to False in the XGrabPointer and remove the
duplicate event detection code to fix this.

Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
(cherry picked from commit f18b5656f6f859e4d4e096d290afd9fae884a5b8)
2023-02-25 10:05:43 -08:00
Ryan C. Gordon
171fba320f
wikiheaders: Fix wikilinks inside code sections a little. Not perfect yet.
(cherry picked from commit 5b0351a672701e28c3bfb17d44a458b82e8a4175)
2023-02-24 14:30:34 -05:00
Sam Lantinga
ad09976eca 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)
2023-02-24 09:23:23 -08:00