Commit graph

11653 commits

Author SHA1 Message Date
Ryan C. Gordon 60070d0b3d
emscripten: Restore compatibility with existing emsdk releases.
(cherry picked from commit 5008521538ffe7931ecd0d11c4a5e75a05f54b5b)
2023-09-20 14:35:51 -04:00
Jaswant Panchumarti 330d420afc
Use EM_ASM_PTR when the return value is a pointer
- closes https://github.com/libsdl-org/SDL/issues/8241

(cherry picked from commit 953b55dd6da1dd9fb937f3c67a18c5cab2988599)
2023-09-20 14:35:02 -04:00
Frank Praznik 2fcbf321fa wayland: Fix drag offer leak
The data device leave function is intended for drag offers, not selections, and the function as was previously written was a no-op.

(cherry picked from commit 52efefca0450758848859b67c14fd853e3ddcf4d)
2023-09-20 11:13:03 -04:00
Colin Kinloch a683ce4153 linux: Add portal drag and drop 2023-09-20 11:01:49 -04:00
Ozkan Sezer 95a6f986a0 update config.guess and config.sub from mainstream 2023-09-20 14:50:56 +03:00
Sam Lantinga 37dee79b74 Fixed sensor timestamp units for third-party PS5 controllers
(cherry picked from commit a72dfa6a5fe8d8901175db852de8686b83487522)
2023-09-18 13:00:33 -07:00
Sam Lantinga 62e7049a4f 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 f6756047a4190d9c82222e4ec378bdb14a72f8d7)
2023-09-18 12:20:22 -07:00
Sam Lantinga fff3c2573a Fixed sensor timestamp calculation for third-party PS5 controllers
(cherry picked from commit 7059a55ccca04b75145c3d23a317fbe1eb77039e)
2023-09-18 11:58:39 -07:00
Guldoman 70a2ac2f1c x11: Always update clipboard owner
This allows utilities like clipboard managers to keep track of the
changes.

(cherry picked from commit 65aaf3a9ab9ec2be2973084060c2df5321b5acaa)
2023-09-15 05:23:02 -07:00
Max Bachmann a8b9414697 detect fanatec steering wheels
(cherry picked from commit fd1c54a004250d844d82bb20ddfe75029585f53a)
2023-09-12 15:36:20 -07:00
Anonymous Maarten 92dc226018 cmake: make sure SDL_GetPrefPath is run before testfilesystem
60 seconds timeout ought to be sufficient.
2023-09-10 15:33:22 +02:00
Anonymous Maarten 2adebcd6cc ci: run tests in parallel 2023-09-10 15:20:34 +02:00
Ryan C. Gordon ce32c44b54 docs: Added Emscripten filesystem notes. 2023-09-09 21:22:45 -04:00
Ryan C. Gordon 818a26f21b docs: Corrected/improved some Emscripten docs. 2023-09-09 21:22:45 -04:00
Ryan C. Gordon 5e6a851d6c docs: Fixed some Emscripten details 2023-09-09 21:22:45 -04:00
Ryan C. Gordon f788a671e4 docs: Remove "more on this later" comment for something already covered. 2023-09-09 21:22:45 -04:00
Ryan C. Gordon bd77b9a0ce docs: Rewrote README-emscripten.md
Fixes #6453.
2023-09-09 21:22:45 -04:00
Simon McVittie 8ad043fc38 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>
2023-09-09 11:14:04 -07:00
Anonymous Maarten b388f6e32d cmake: use MSVC_RUNTIME_LIBRARY to force MT 2023-09-09 19:16:31 +02:00
Ryan C. Gordon 25eca09c7e
include: Replaced old Bugzilla URL.
(cherry picked from commit fb137703537411b9aa2206351082b87aba23a843)
2023-09-07 10:53:02 -04:00
Frank Praznik 88299502b4 wayland: Ensure that the toplevel window is recreated when switching decoration modes
If a compositor tries to change the decoration mode when initially creating a window, the hidden flag might not yet be unset if the decoration mode is changed during the initial roundtrip in Wayland_ShowWindow(). As hiding the window destroys the decoration manager object, the hidden flag check is unnecessary, as the decoration configuration listener will never be entered when the window is hidden.

(cherry picked from commit 37e1fc3b5894f379f4f8253b867a76a135213a7d)
2023-09-06 14:56:16 -04:00
Makarenko Oleg 1d495351a0 Detect Simagic wheel bases as wheels (#8198)
Simagic DirectDrive wheel bases have the same vendor + product id's

(cherry picked from commit a2c1984d371e86e97bd6ffb176e835925e6afb3a)
2023-09-04 12:12:21 -07:00
Oleg 365a36386a 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 266b91d2fd2b3362d1828f8a6b58589bdaa4f75d)
2023-09-04 11:05:52 -07:00
Oleg 242b25aba4 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 cde67ea49ad812088bd5c8cfd67ef090ac1c1d86)
2023-09-04 11:01:52 -07:00
Jeremy Demeule aa7ba62978 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).
2023-08-31 01:55:18 -07:00
Anonymous Maarten 0b995f21e7 wayland: add SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL 2023-08-30 23:03:47 +02:00
Anonymous Maarten bb1fe302cf wayland: don't define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_* macro's
They mess with #ifdef conditional in headers.
2023-08-30 22:46:17 +02:00
Ozkan Sezer f032e8c191 updated dynapi after SDL_GDKGetDefaultUser addition 2023-08-25 19:03:40 +03:00
Ethan Lee 24fcb61470 – gdk: Add SDL_GDKGetDefaultUser, SDL_GetPrefPath implementation 2023-08-25 10:41:14 -04:00
Sam Lantinga 6ff48dddcb Fixed the report format for the Razer Wolverine V2 Pro
(cherry picked from commit 69aec8c915b5cddae2bb6171d7d5404f4d779db3)
2023-08-24 11:38:18 -07:00
Sam Lantinga 862a654b70 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:11:53 -07:00
Sam Lantinga 8e27a69370 Updated to Android minSdkVersion 19 and targetSdkVersion 34
This is updated to meet the latest requirements for apps on the Google Play store
2023-08-24 08:26:05 -07:00
Ryan C. Gordon 9237f8edc1
video: Fixed small memory leak when disconnecting a display. 2023-08-23 16:27:10 -04:00
Ryan C. Gordon 1f4e86d61c
video: Minor cleanup in SDL_VideoQuit.
(This code changed in SDL3, no need to cherry-pick it to there.)
2023-08-23 16:27:09 -04:00
Ryan C. Gordon 04ff593bf5
emscriptenaudio: Fire the capture silence_callback at an interval.
Previously it was using setTimeout, not setInterval, so it would only fire
once, which was obviously a mistake.

(cherry picked from commit fb79211732d0cdf17a250a43c619b6938842cfaf)
2023-08-23 16:25:30 -04:00
Ryan C. Gordon ddbbef88e3
emscriptenaudio: Don't bother undefining things about to be unreachable.
Since the top-level table is getting undefined, all the things in it will
be unreachable and eligible for garbage collection without explicitly
nulling them out.

(cherry picked from commit 5191b20541fce0e3b3071124ced69c31fcaeb783)
2023-08-23 16:24:09 -04:00
Ryan C. Gordon ae7f54f514
emscriptenaudio: Deal with blocked audio devices better.
Now, if the AudioContext starts in a "suspended" state, because the browser
blocked it from playing by default, we we run the audio "thread" in a timer
and throw away the generated audio. Once the AudioContext is allowed to
resume, we clear this timer.

The end result is that the app will continue to drain its audio queue
instead of consuming more memory over time (and, if it relies on an audio
callback to make progress, continue to run!), with the effect that the
page is merely silent but otherwise functioning as intended.

Once the user interacts with the page and the browser permits the the
AudioContext to run for real, audio should still be in sync, instead of
just starting to play audio that might now be at least several seconds behind.

(cherry picked from commit fd75a4ca05bdbd7b0fecf781e59c77a07d264b16)
2023-08-23 16:21:49 -04:00
Sam Lantinga 0b9d8e679a Quiet spurious warning
Fixes https://github.com/libsdl-org/SDL/issues/8112
2023-08-13 13:54:18 -07:00
David CARLIER 4a0f56b679 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 723bcd0a8be4e816f6555b6bbbd5e9c26ab27137)
2023-08-13 23:02:02 +03:00
Anonymous Maarten 10135b2d7b Fix overflow when doing SDL_sscanf("%hd", ...)
An overflow occured in the stdlib_sscanf test, when using msys2 clang32 toolchain.

(cherry picked from commit 342ec5113171214154cb197bb3e0e3a0056ea2ad)
2023-08-10 15:06:57 -07:00
Mathieu Eyraud f348370e1b Fix out of bound read of 'has_hat' array
(cherry picked from commit 94b3f78c440bfd52182848adf39db71325861e9c)
2023-08-10 08:26:45 -07:00
Sam Lantinga 951657c99b Fixed crash when running with the dummy video driver 2023-08-10 08:25:29 -07:00
Sam Lantinga 7df721d4e9 Allow running tests with the dummy video driver 2023-08-10 08:25:29 -07:00
Anonymous Maarten 0465224616 Sync -Wsign-compare warning fix from sdl2-compat 2023-08-09 02:53:48 +02:00
Anonymous Maarten 9d6b028e01 tests: build tests with fast math disabled 2023-08-09 02:53:48 +02:00
Anonymous Maarten fcae9cd210 cmake: build with -Wdocumentation 2023-08-09 02:53:48 +02:00
Anonymous Maarten e5f3b22d63 cmake: update cmake_minimum_required to avoid deprecated warning 2023-08-09 02:53:48 +02:00
Anonymous Maarten 64f17314a2 MSVC has __declspec(deprecated) 2023-08-09 02:53:48 +02:00
Sam Lantinga 1d8806b0fc 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:04 +03:00
Sam Lantinga e56dc9c30e 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:04 +03:00