Commit graph

11678 commits

Author SHA1 Message Date
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
Sam Lantinga 4bceea70c5 Added the Victrix Pro FS for PS4/PS5 to the controller list
(cherry picked from commit fa189d302e93ceca7db194709563b901ae1bbfd4)
2023-08-07 14:10:56 -07:00
Ryan C. Gordon 8087c0a5d2
include: fixed a typo in SDL_RenderGetMetalCommandEncoder docs. 2023-08-06 10:45:11 -04:00
Ozkan Sezer 53d818e31c updated config.guess and config.sub from mainstream 2023-08-05 14:03:02 +03:00
Frank Praznik f522c5380c wayland: Don't initialize OpenGL when the window flags didn't specify it
Applications that don't specify a rendering flag are likely handling Vulkan/GL themselves, so SDL loading OpenGL by default in this case is unnecessary overhead, and if a render backend requires it, the window will be recreated with the appropriate flags when the renderer is initialized.

(cherry picked from commit 9ab20251277d001ee34caeb59a7eaa54b40af622)
2023-08-04 08:53:16 -07:00
Sam Lantinga 2304b4e86a Added a gamepad mapping for the G-Shark GS-GP702
Fixes https://github.com/libsdl-org/SDL/issues/8068

(cherry picked from commit 06bea1eb5544e778c1258d3d7f47f6d06110c379)
2023-08-02 14:38:29 -07:00
Sam Lantinga 0f753d9794 The Flydigi Vader and Apex series controllers all have the same VID, PID, and name
(cherry picked from commit 58e3084477afe344bae42ab352d56eba25b4a36b)
2023-08-02 14:38:23 -07:00
Sam Lantinga 805fc29ae8 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 5388edd5494030b8c43b2f79e3f5c9b71f57a703)
2023-08-02 14:38:01 -07:00
Ozkan Sezer 57f3c41b97 adjusted coding style in SDL_os2_joystick.c to match rest of SDL better 2023-08-02 20:40:10 +03:00
Ozkan Sezer b58557a3a6 minor os/2 stuff merged from the bitwiseworks' fork
(cosmetics only.)
2023-08-02 17:10:28 +03:00
Ozkan Sezer 6a787b8004 SDL_video.c: move ngage video before offscreen.
Reference issue: https://github.com/libsdl-org/SDL/pull/8069.
(cherry picked from commit e2e87a536c1d05c41243747ad8e755398803b185)
2023-08-02 17:00:40 +03:00
Ozkan Sezer 0deed07b3e SDL_video.c: move os2 video before offscreen.
as offscreen is enabled in CMakeLists.txt, we get a blanks window
otherwise.

From a patch by Silvan Scherrer, at Bitwiseworks' fork.
(cherry picked from commit 66d5ad19f0260f42426a66fe664b6e98291faa37)
2023-08-02 17:00:40 +03:00
Sam Lantinga ebf2c49b50 Fixed build 2023-08-02 01:37:05 -07:00
Sam Lantinga 38c63afd64 Fixed duplicate key press/release events on iOS
When a hardware keyboard is attached, it can take over 100 ms for the keyboard event to generate text input. In that case we want to record that we recently received a keyboard event so we don't synthesize duplicate virtual key press/release events for the input text.

(cherry picked from commit 648de4f9b8ebcf9e794aba2ec2955d129167c48b)
2023-08-02 01:27:54 -07:00
Sam Lantinga 030bb7282a Synchronize on-screen keyboard state with text input active state
When a hardware keyboard is attached to an iPad, you can easily trigger a set of on-screen keyboard transitions that will take place over time, and we need to track whether we're currently showing or hiding the keyboard and make sure we don't clobber the existing state during those transitions.

Testing:
* Connected a hardware keyboard to an iPad
* Launched checkkeys
* Noted the keyboard bar was active at the bottom of the screen and text input was active
* Tapped with both fingers to quickly toggle text input off and back on
* Noted the keyboard bar slid down and then back up, and text input was active
* Tapped on the keyboard bar to bring up the full on-screen keyboard and then closed it so the keyboard bar was still active, and text input was still active
* Tapped on the screen to turn text input off, noted the keyboard bar slid down
* Tapped with both fingers to quickly toggle text input on and back off
* Noted that the keyboard bar slid up and then back down, and text input was inactive
* Tapped on the screen to turn text input on, tapped on the keyboard bar to bring up the full on-screen keyboard, and text input was active
* Pressed a key on the physical keyboard, the on-screen keyboard closed, the key press and release was delivered (with no text input) and then the keyboard bar slid up, and text input was active again

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

(cherry picked from commit c3288d113e434b20d2f0dda73210d3a52504d199)
2023-08-02 01:17:15 -07:00
Sam Lantinga 335e9c769a Only pass keypresses up the responder chain when text input is active
This is another attempt to make sure we don't cause beeps from unhandled key presses while still allowing full text input functionalty.

If this isn't selective enough, we might need to go up the responder chain to see what's going to handle the event before passing it along.

Fixes https://github.com/libsdl-org/SDL/pull/6962

(cherry picked from commit a8abe612ed5597cbaabb903c0121b5b48baee91d)
2023-08-02 01:14:07 -07:00
Sam Lantinga 5e9320f6b5 Revert "Stop beep when running iOS apps on ARM-based Macs"
This reverts commit bbf38bbbc334bc0ee90d3eec228a968d8fc1689e, which prevented text input from working when a hardware keyboard was connected, since key strokes don't get to the text input field.

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

(cherry picked from commit f5ea6ae18d860796184b9b31a2005957cb7e30a2)
2023-08-02 01:12:21 -07:00
Sam Lantinga e2afc1f37a Fixed build 2023-08-01 18:58:21 -07:00
Sam Lantinga 2468fccf7f Fixed crash if a display is enumerated twice
This can happen if a monitor is in the process of becoming primary because another monitor was disconnected.

(cherry picked from commit 07578fde3dad2dadd605f5b18399c8d021f6ae5d)
2023-08-01 18:30:24 -07:00
Ryan C. Gordon dc5dda0f31 cocoa: Ignore first mouse motion event after enabling relative mode.
Fixes #7918.
2023-08-01 18:34:03 -04:00
Ryan C. Gordon 3030fd815c
x11: Blocking for window maximization should wait 100 ms, not 1000.
Reference Issue #7070.
2023-08-01 13:55:04 -04:00
Ryan C. Gordon 5c3df60ec9
Revert "x11: check if window size/position has changed during SDL_ShowWindow."
This reverts commit aa536217b3.
2023-08-01 12:10:52 -04:00
Sam Lantinga 8825fbf713 Fall back to Xlib if XRandR isn't available
This fixes video initialization on headless systems with VNC

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

(cherry picked from commit 71099149b8fc062ea0ece232ccdd9f0ee9b3588b)
2023-07-31 14:41:34 -07:00
Mathieu Eyraud 82cd3bfe1c Add missing break
(cherry picked from commit 0500fca00c141cc4ab9be15ce5ddb7bc8c5c17b2)
2023-07-29 17:33:10 +03:00
Ozkan Sezer 7cc3248044 minor os/2 stuff merged from the bitwiseworks' fork 2023-07-28 23:55:50 +03:00
Ozkan Sezer 3e341021c3 fixed typo in prev. patch. 2023-07-28 07:35:14 +03:00