Commit Graph

16777 Commits

Author SHA1 Message Date
Sylvain
deba9f4b8b testime.c: fix various warnings + test error code from SDL_RWread, changing bytesRead to Sint64 (thanks Ozkan) see #6818 2022-12-15 14:11:08 +01:00
Sylvain Becker
1e6d4649c0 fixed build rwops (#6818)
* Fixed build
2022-12-15 10:06:15 +01:00
Ryan C. Gordon
c637031294 rwops: Fixed another Windows build failure. 2022-12-15 00:16:02 -05:00
Ryan C. Gordon
4075748e41 rwops: Removed unused variable in Windows-specific code. 2022-12-15 00:09:32 -05:00
Brian Kirkpatrick
e35730ac54 fixed const error when compiling for mutated total_need value in SDL_rwops.c 2022-12-14 20:25:40 -08:00
Ryan C. Gordon
83559503c4 test: patched to compile. 2022-12-14 23:25:09 -05:00
Sam Lantinga
980208b814 Fixed crash in SDL_PrivateGameControllerRefreshMapping()
(cherry picked from commit 7a9966af9d)
2022-12-14 20:24:14 -08:00
Ryan C. Gordon
72c1f73bc5 rwops: Make read and write work like POSIX, not stdio.
This simplifies some things, clarifies some things, and also allows
for the possibility of RWops that offer non-blocking i/o (although
none of the current built-in ones do, intentionally, we could add this
later if we choose, or people could provide things like network socket
RWops implementations now, etc.

Fixes #6729.
2022-12-14 15:47:13 -05:00
Frank Praznik
e9a9afaded wayland: Look up pressed keys via keycodes instead of scancodes on keyboard entry
On window focus, look up the pressed modifier keys via keycodes instead of scancodes to handle the case of remapped keys, as xkb remapping changes the associated keycode, not the scancode.
2022-12-14 11:31:40 -08:00
Sam Lantinga
3a940ba8ee Updated gendynapi.py to handle thread-safety annotations 2022-12-14 09:59:56 -08:00
Sam Lantinga
5c29b58e95 Added support for clang thread-safety analysis
The annotations have been added to SDL_mutex.h and have been made public so applications can enable this for their own code.

Clang assumes that locking and unlocking can't fail, but SDL has the concept of a NULL mutex, so the mutex functions have been changed not to report errors if a mutex hasn't been initialized. We do have mutexes that might be accessed when they are NULL, notably in the event system, so this is an important change.

This commit cleans up a bunch of rare race conditions in the joystick and game controller code so now everything should be completely protected by the joystick lock.

To test this, change the compiler to "clang -Wthread-safety -Werror=thread-safety -DSDL_THREAD_SAFETY_ANALYSIS"
2022-12-14 09:53:39 -08:00
Sylvain Becker
02493579b5 DBus: add a reference to the connection
Fixed bug #6712
2022-12-14 11:41:35 -05:00
Sylvain Becker
e0ee9fa80c Fix build (#6808) 2022-12-14 09:47:15 +01:00
Ryan C. Gordon
5a2d0b69c8 render: Remove SDL_GetRenderDriverInfo and change SDL_CreateRenderer.
Fixes #6625.
2022-12-13 23:27:35 -05:00
Ozkan Sezer
1230a8fde8 fix (hopefully) MSVC builds after gesture removal. 2022-12-14 00:50:20 +03:00
Ryan C. Gordon
a76053352c gesture: Removed the gesture API from SDL3.
Fixes #6758.
2022-12-13 14:54:37 -05:00
Simon McVittie
07fa2769b8 cmake: Fix detection of ALSA::ALSA for static linking
This was still conditional on whether SDL2::SDL2-static exists, but
it's now SDL3 that matters.

Resolves: https://github.com/libsdl-org/SDL/issues/6801
Fixes: 9eb4d1f "cmake: use FindALSA.cmake to find ALSA libraries"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-13 09:03:48 -05:00
Simon McVittie
45ebdfb1dc emscripten: Replace a stray reference to SDL2 with SDL3
Entirely untested, but I'm fairly sure this is what was intended.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-13 09:03:11 -05:00
Simon McVittie
4a46a9e372 .gitignore: Replace all SDL2 with SDL3
Some of these are probably unnecessary now that Autotools (with its
optional in-tree builds) has been deleted in favour of CMake (with
mandatory out-of-tree builds), but let's be consistent.

Spotted while doing a `git grep` for other bugs of the same form as #6801.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-12-13 09:02:28 -05:00
Sam Lantinga
650e16a824 Detect display change when fullscreen desktop windows move displays
This happens when using Win+Alt+Left/Right on a resizable fullscreen desktop window on Windows
2022-12-12 20:26:17 -08:00
Sam Lantinga
a506d798d8 Don't try to open the Razer Huntsman Elite keyboard as a controller
(cherry picked from commit 817454cfe6)
2022-12-12 18:01:32 -08:00
Ryan C. Gordon
12486e144b wasapi: Fixed incorrect assertions.
Fixes #6795.
2022-12-12 16:07:48 -05:00
Frank Praznik
90a964f132 wayland: Set xdg surface geometry
It was previously thought that these function calls were unnecessary as the initial bug and reproduction case that necessitated their addition seemed to be fixed, but apparently there are still cases where this needs to be set explicitly. Set the xdg surface geometry at creation time and when the window size changes.

Partially reverts #6361.  This is not needed in the libdecor path, as libdecor calls this for the content surface internally.
2022-12-12 11:21:20 -08:00
Sam Lantinga
618340bf99 Added support for the STRIKEPAD PS4 Grip Add-on to the HIDAPI driver 2022-12-12 10:55:38 -08:00
Anonymous Maarten
9eb4d1f020 cmake: use FindALSA.cmake to find ALSA libraries
Co-authored-by: nfarid <54642193+nfarid@users.noreply.github.com>
2022-12-12 01:37:01 +01:00
Pierre Wendling
053ce39d67 N3DS: Semaphore fixes. (#6776)
* N3DS: Make Sem waits cooperative friendly.

The 3DS has a cooperative threading model. Sleeping after TryWait and
WaitTimeout avoid starving other threads. It inccurs a runtime penalty,
but it's better than having to hard reset your console to recover from
a deadlock.
2022-12-11 11:27:16 -08:00
Kelly Gravelyn
bb6abd7b03 Remove OutDir and IntDir from GDK projects 2022-12-10 09:50:47 -08:00
Sylvain
e5a470d0d3 Update DYNAPI SDL_WinRTRunApp() prototype which was wrong (see #6783) 2022-12-10 17:54:16 +01:00
Sylvain
3d190ebcb4 SDL_dynapi_procs: fixed SDL_UIKitRunApp prototype (see #6783) 2022-12-10 17:45:56 +01:00
Sylvain
a38ea6bad2 SDL_assert: remove old define for obsolete naming 2022-12-10 17:21:51 +01:00
Sylvain
f906c52ee6 SDL_assert: remove old naming convention (see #6783) 2022-12-10 17:19:00 +01:00
Sylvain
2905b6d65a SDL_dynapi_procs: update wrong naming conventions with SDL_AssertState/Data (see #6783) 2022-12-10 17:15:14 +01:00
Ryan C. Gordon
16f8dfcef9 docs: Note that you don't need to free SDL_GetDefaultCursor's results.
Reference Issue #6777.
2022-12-09 22:08:40 -05:00
Sylvain
99baebf5eb SDL_dynapi_procs.h: one more space (for diff purpose) 2022-12-09 20:42:01 +01:00
Sylvain
b7008e4614 SDL_dynapi_procs: remove extra ' ' 2022-12-09 20:36:34 +01:00
Sylvain
cce1341b5b gendynapi.py: don't generate parameter for '...' - corrected 2022-12-09 20:34:13 +01:00
Sylvain
f442d0a0ef Revert "gendynapi.py: don't generate parameter for '...'"
This reverts commit ea8c7df91b.
2022-12-09 20:33:14 +01:00
Sylvain
ea8c7df91b gendynapi.py: don't generate parameter for '...' 2022-12-09 20:22:44 +01:00
Sylvain
5f89987d7f Fixed extra 'space' (see #6783 Thanks @sezero !) 2022-12-09 20:09:17 +01:00
Sam Lantinga
3736005fc4 Added test event logging for SDL_WINDOWEVENT_ICCPROF_CHANGED and SDL_WINDOWEVENT_DISPLAY_CHANGED 2022-12-09 10:23:00 -08:00
Sylvain
b116dd8eb8 gendynapi.py: add comment for OS-specific API (Thanks @DanielGibson!) 2022-12-09 09:27:19 +01:00
Sam Lantinga
cfa493c97f Use the current timestamp for keyboard hook events
Fixes https://github.com/libsdl-org/SDL/issues/6771
2022-12-08 23:13:13 -08:00
Sam Lantinga
5bc80abe0d Added logging for SDL_DISPLAYEVENT_MOVED
(cherry picked from commit be3b1cff0b)
2022-12-08 17:04:27 -08:00
Sam Lantinga
7d1bf0a9fe Make sure the display list is up to date for window placement
(cherry picked from commit ab479b4961)
2022-12-08 17:04:11 -08:00
Sam Lantinga
a4a80360f5 Added SDL_DISPLAYEVENT_MOVED to detect when display positioning changes
(cherry picked from commit 264da8c127)
2022-12-08 12:47:56 -08:00
Sam Lantinga
98fa97de91 Fixed memory leak when removing existing displays
(cherry picked from commit cfc7cac3c9)
2022-12-08 12:46:50 -08:00
Frank Praznik
653e484da1 wayland: Handle the Num Lock and Caps Lock modifiers via modifier events
Num Lock and Caps Lock always need to be explicitly handled by the modifier handler function, or they won't be correctly set if active at application startup, or if the lock state is changed while the application lacks focus since a key press for these keys will never be received.  In these cases, the internal SDL modifier state can end up the inverse of the actual modifier state.
2022-12-08 09:29:37 -08:00
Sylvain
e93769d2c9 Extract the name of a callback paramter 2022-12-08 08:55:27 -08:00
Sylvain
67a4094eea Rewrite + gendynapi into python 2022-12-08 08:55:27 -08:00
Sylvain
c265fb74b0 Renamed AUDIODRIVER and VIDEODRIVER hint/env to AUDIO_DRIVER and VIDEO_DRIVER 2022-12-08 09:50:09 -05:00