Commit Graph

11517 Commits

Author SHA1 Message Date
Ryan C. Gordon
5be746acbc x11: Properly check for XInput2 support before using it.
This specifically fixes a crash in X11_WarpMouseInternal if XInput2 was
missing at runtime, but also cleans up a few other existing checks.

Fixes #8378.

(cherry picked from commit 82f54af617)
(cherry picked from commit 2849ca404e)
2023-10-11 01:11:01 -04:00
Anonymous Maarten
2abefb1c16 ci: stop FreeBSD job after 30 minutes
(cherry picked from commit aee4862958)
2023-10-11 00:23:41 +02:00
Ozkan Sezer
6fc17b0e2b artsaudio: revert bad arts_init return code check from commit ce5da5d. 2023-10-10 10:40:00 +03:00
Frank Praznik
1f7ec57d3b wayland: Unref the libdecor window when hiding
Hiding the decorations while not unreferencing the frame was a workaround for an internal libdecor use-after-free bug that was fixed some time ago. Revert to unreferencing the window when hiding to ensure that it is properly destroyed.

Reverts dd2e318
2023-10-05 20:26:29 +02:00
Anonymous Maarten
36eb4845b5 triangle: don't read destination pixel when you're going to discard it anyways 2023-10-05 15:00:06 +02:00
Anonymous Maarten
d5ba5bb05f blit_slow: don't read destination pixel when you're going to discard it anyways
(cherry picked from commit 4cd0c13823)
(cherry picked from commit 2d5c05a69c)
2023-10-04 19:43:03 -07:00
Sam Lantinga
cc016b0046 Updated to version 2.28.4 for release release-2.28.4 2023-10-01 12:05:05 -07:00
Anonymous Maarten
8c3fd5aec2 snd_pcm_plugin_flush was removed in QNX 7.1 and later
Co-authored-by: elahav <elahav@users.noreply.github.com>
2023-09-30 16:53:53 +02:00
Anonymous Maarten
24d145f4b6 cmake: add qnx support
Co-authored-by: elahav <elahav@users.noreply.github.com>
2023-09-30 16:53:53 +02:00
Anonymous Maarten
145ad48c0e Allow the use of posix_spawn() instead of vfork/execlp()
Backport of #7041

Co-authored-by: elahav <elahav@users.noreply.github.com>
2023-09-30 16:53:53 +02:00
Simon McVittie
fd495bb57c SDLTest_CompareSurfaces: Decode pixels correctly on big-endian platforms
Previously, if acting on a surface with less than 32 bits per pixel,
this code was placing the pixel value from the surface in the first
few bytes of the Uint32 to be decoded, and unrelated data from a
subsequent pixel in the remaining bytes.

Because SDL_GetRGBA takes the bits to be decoded from the
least-significant bits of the given value, ignoring the higher-order
bits if any, this happened to be correct on little-endian platforms,
where the first few bytes store the least-significant bits of an
integer.

However, it was incorrect on big-endian, where the first few bytes are
the most-significant bits of an integer.

The previous implementation also assumed that unaligned access to a
32-bit quantity is possible, which is not the case on all CPUs (but
happens to be true on x86).

These issues were not discovered until now because
SDLTest_CompareSurfaces() is only used in testautomation, which until
recently was not being run routinely at build-time, because it contained
other assumptions that can fail in an autobuilder or CI environment.

Resolves: https://github.com/libsdl-org/SDL/issues/8315
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit d95d2d7051)
(cherry picked from commit 6b5eadb10f)
2023-09-29 06:57:07 -07:00
Sam Lantinga
d58fa94ee9 SDL_iconv_string() defaults to UTF-8
Fixes https://github.com/libsdl-org/SDL/issues/8287

(cherry picked from commit 1375d2049d)
(cherry picked from commit 9772d0512c)
2023-09-24 17:28:23 -07:00
Sam Lantinga
d691010686 Check for NULL before dereferencing newly allocated memory
Fixes https://github.com/libsdl-org/SDL/issues/8289

(cherry picked from commit 70a1bc6973)
(cherry picked from commit 27f2df2292)
2023-09-24 17:19:03 -07:00
Ryan C. Gordon
b93a8a86ab emscripten: Restore compatibility with existing emsdk releases.
(cherry picked from commit 5008521538)
2023-09-20 14:37:56 -04:00
Jaswant Panchumarti
536f625bde Use EM_ASM_PTR when the return value is a pointer
- closes https://github.com/libsdl-org/SDL/issues/8241

(cherry picked from commit 953b55dd6d)
2023-09-20 14:37:24 -04:00
Ozkan Sezer
1e18dc594e update config.guess and config.sub from mainstream 2023-09-20 14:50:56 +03:00
Sam Lantinga
cc4973ea45 Fixed sensor timestamp units for third-party PS5 controllers
(cherry picked from commit a72dfa6a5f)
(cherry picked from commit 37dee79b74)
2023-09-18 13:00:50 -07:00
Sam Lantinga
8114bd9108 Fixed error: array subscript 2 is above array bounds of ‘const Uint8[2]’
Smart compilers don't like dereferencing off the end of arrays

(cherry picked from commit f6756047a4)
(cherry picked from commit 62e7049a4f)
2023-09-18 12:20:36 -07:00
Sam Lantinga
495fca1517 Fixed sensor timestamp calculation for third-party PS5 controllers
(cherry picked from commit 7059a55ccc)
(cherry picked from commit fff3c2573a)
2023-09-18 11:59:00 -07:00
Sam Clegg
7d80e20883 emscripten: Add JS library dependencies using EM_JS_DEPS macro
See https://github.com/emscripten-core/emscripten/pull/19780

(cherry picked from commit 042243471f)
2023-09-15 15:29:47 -07:00
Guldoman
f3847c157a x11: Always update clipboard owner
This allows utilities like clipboard managers to keep track of the
changes.

(cherry picked from commit 65aaf3a9ab)
(cherry picked from commit 70a2ac2f1c)
2023-09-15 05:23:21 -07:00
Max Bachmann
b576e29d9b detect fanatec steering wheels
(cherry picked from commit fd1c54a004)
(cherry picked from commit a8b9414697)
2023-09-12 15:36:41 -07:00
Anonymous Maarten
c7ad8e5431 cmake: make sure SDL_GetPrefPath is run before testfilesystem
60 seconds timeout ought to be sufficient.
2023-09-10 15:34:29 +02:00
Anonymous Maarten
9c8ee3a154 ci: run tests in parallel 2023-09-10 15:34:29 +02:00
Simon McVittie
d710e0be27 render: Enable clipping for zero-sized rectangles
Battle for Wesnoth apparently relies on being able to disable rendering
of UI elements by setting the clip rectangle to be empty.

Resolves: https://github.com/libsdl-org/SDL/issues/6896
Fixes: 00f05dcf "render: only enable clipping when the rectangle is valid"
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 8ad043fc38)
2023-09-09 11:14:25 -07:00
Anonymous Maarten
b8d1f852db cmake: use MSVC_RUNTIME_LIBRARY to force MT 2023-09-09 19:17:36 +02:00
Makarenko Oleg
e9ab663c43 Detect Simagic wheel bases as wheels (#8198)
Simagic DirectDrive wheel bases have the same vendor + product id's

(cherry picked from commit a2c1984d37)
(cherry picked from commit 1d495351a0)
2023-09-04 12:12:37 -07:00
Oleg
c8d1de1a9b Detect Logitech G923 Playstation as wheel
G923 have two different versions - Xbox version is already present in the wheel list, but not the PS version.

(cherry picked from commit 266b91d2fd)
(cherry picked from commit 365a36386a)
2023-09-04 11:06:06 -07:00
Oleg
bf8c9cd6bf Detect Logitech PRO Racing Wheel for Xbox (PC mode) as wheel
Logitech PRO Racing Wheel have two different versions - for Playstation and Xbox. Vendor + Product ID for Playstation version already present in SDL sources, but not an Xbox version

(cherry picked from commit cde67ea49a)
(cherry picked from commit 242b25aba4)
2023-09-04 11:02:09 -07:00
Sam Lantinga
8a5ba43d00 Updated to version 2.28.3 for release release-2.28.3 2023-09-01 11:22:07 -07:00
Jeremy Demeule
c25a49c406 metal: Add hint to select low power device instead of the default one (#8182)
On some system like MacBook Pro Intel with AMD card, asking for the default device will always return the AMD GPU.
This is not an issue for 99% of the case when the renderer context is here to provide the maximum performance level like for game.
However, for video application using GPU for 1 quad and 1 texture, using the discrete GPU for that lead to an important power consumption (4 to 8W), heat increase, and fan noise.
With this patch, I successfully amend ffplay to only use the integrated GPU (i.e. the Intel one), instead of the discrete GPU (i.e. the AMD one).

(cherry picked from commit aa7ba62978)
2023-08-31 01:55:40 -07:00
Anonymous Maarten
d46fdfa3ee wayland: add SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL 2023-08-30 23:03:29 +02:00
Anonymous Maarten
787d339282 wayland: don't define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_* macro's
They mess with #ifdef conditional in headers.
2023-08-30 22:46:53 +02:00
Sam Lantinga
874f6feab4 Fixed the report format for the Razer Wolverine V2 Pro
(cherry picked from commit 69aec8c915)
(cherry picked from commit 6ff48dddcb)
2023-08-24 11:39:15 -07:00
Sam Lantinga
1df4dce78f Accept key events from any source
This allows TV remotes to navigate SDL applications (with source HDMI)

Fixes https://github.com/libsdl-org/SDL/issues/8137
2023-08-24 10:12:04 -07:00
Sam Lantinga
cc58a09c09 Updated to Android minSdkVersion 19 and targetSdkVersion 34
This is updated to meet the latest requirements for apps on the Google Play store

(cherry picked from commit 8e27a69370)
2023-08-24 08:33:04 -07:00
Sam Lantinga
ae72cd57b5 Quiet spurious warning
Fixes https://github.com/libsdl-org/SDL/issues/8112

(cherry picked from commit 0b9d8e679a)
2023-08-13 13:54:45 -07:00
David CARLIER
8f858d7908 SDL_TriggerBreakppoint for riscv arch (both 32/64) version.
`ebreak` acts like int3 for x86, giving control of running process to debuggers.
(cherry picked from commit 723bcd0a8b)
2023-08-13 23:02:20 +03:00
Anonymous Maarten
5bfdb6e02f Fix overflow when doing SDL_sscanf("%hd", ...)
An overflow occured in the stdlib_sscanf test, when using msys2 clang32 toolchain.

(cherry picked from commit 342ec51131)
(cherry picked from commit 10135b2d7b)
2023-08-10 15:07:11 -07:00
Mathieu Eyraud
739d3ec189 Fix out of bound read of 'has_hat' array
(cherry picked from commit 94b3f78c44)
(cherry picked from commit f348370e1b)
2023-08-10 08:27:11 -07:00
Sam Lantinga
2319b2635b Fixed testautomation --filter pixels_allocFreePalette
Error messages are not part of the ABI, so we can't validate those.

Hand-picked from c9323f8fac
2023-08-08 11:50:00 +03:00
Sam Lantinga
bda161d22b Fixed testautomation --filter pixels_allocFreeFormat
Error messages are not part of the ABI, so we can't validate those.

Technically SDL_AllocFormat() on a FOURCC format in SDL2 should fail, but SDL3 supports it and we don't expect SDL2 applications to actually do this, so skip that test.

Hand-picked from 5cf9438f88
2023-08-08 11:50:00 +03:00
Anonymous Maarten
dbfd47e77d cmake: update cmake_minimum_required to avoid deprecated warning 2023-08-07 19:03:18 +02:00
Ryan C. Gordon
dbb6cd02aa include: fixed a typo in SDL_RenderGetMetalCommandEncoder docs.
(cherry picked from commit 8087c0a5d2)
2023-08-06 10:45:34 -04:00
Ozkan Sezer
841263c9d6 updated config.guess and config.sub from mainstream 2023-08-05 14:03:02 +03:00
Sam Lantinga
2ccb311cb7 Added a gamepad mapping for the G-Shark GS-GP702
Fixes https://github.com/libsdl-org/SDL/issues/8068

(cherry picked from commit 06bea1eb55)
(cherry picked from commit 2304b4e86a)
2023-08-02 14:39:09 -07:00
Sam Lantinga
e0a345702d The Flydigi Vader and Apex series controllers all have the same VID, PID, and name
(cherry picked from commit 58e3084477)
(cherry picked from commit 0f753d9794)
2023-08-02 14:39:09 -07:00
Sam Lantinga
9fba36511f Removed Flydigi Vader 2 mappings
Many of the Flydigi controllers use the same VID/PID and have different mappings, so let's revisit this once we have more data.

(cherry picked from commit 5388edd549)
(cherry picked from commit 805fc29ae8)
2023-08-02 14:39:09 -07:00
Ozkan Sezer
45fb778fe5 adjusted coding style in SDL_os2_joystick.c to match rest of SDL better
(cherry picked from commit 57f3c41b97)
2023-08-02 20:40:24 +03:00
Sam Lantinga
031912c4b6 Updated to version 2.28.2 for release release-2.28.2 2023-08-02 08:31:42 -07:00