Commit Graph

21570 Commits

Author SHA1 Message Date
Al. Lopez
98ed044509 added additional examples of paddle/misc buttons for Steam Controller (#15544)
(cherry picked from commit 4940345a2e)
2026-05-11 21:45:39 -07:00
Sam Lantinga
ef3196bedd Fixed a crash if we get a HID device with no path
This can happen on Linux if udev_device_get_devnode() fails.

(cherry picked from commit bb4eedd67d)
2026-05-11 16:48:43 -07:00
Rachel Blackman
717bb2dcef Correctly support OG Steam Controller when connected via USB on Android (#15561)
(cherry picked from commit e4a327709d)
2026-05-11 15:23:50 -07:00
Rachel Blackman
7e101bdce9 Ensure Android gamepad mappings don't lose the first button.
(cherry picked from commit fd3cfb97c1)
2026-05-11 12:59:59 -07:00
Evan Hemsley
d348116157 GPU: Fix segfault when copying to Vulkan swapchain (#15543)
(cherry picked from commit 76f8705c12)
2026-05-11 11:42:55 -07:00
Rachel Blackman
2b7c3d8a6c *Only* preserve report byte for feature reports. Oops.
(cherry picked from commit 7ec70d39c4)
2026-05-11 11:33:20 -07:00
Nintorch
b52e6d10ce Ignore Keychron K10 Pro and Huion Tablet_GS1331
(cherry picked from commit 287e2573cd)
2026-05-11 11:11:24 -07:00
Cameron Gutman
a61f02cc88 atomic: Implement loads on MSVC without RMW operations
This fixes faults when loading from read-only memory and avoids
cache line bouncing across cores which reduces performance.

(cherry picked from commit 7439a94ed2)
2026-05-11 06:43:40 -07:00
Frank Praznik
321557f339 x11: Store the mouse button serial for emulated pointer events as well
Otherwise, filtered emulated button events, such as for mouse wheels, can slip through the core event handler.

(cherry picked from commit f48525aa70)
2026-05-10 14:18:06 -04:00
Evan Hemsley
7a827b145a GPU: Validate that 2D textures don't have layers (#15535)
(cherry picked from commit cbe3fbe9f3)
2026-05-07 19:21:10 -07:00
Evan Hemsley
a14da0d366 GPU: Allow depth texture arrays (#15534)
(cherry picked from commit d08ef12b12)
2026-05-07 16:41:09 -07:00
Frank Praznik
7cdf4fd7ee wayland: Ensure window dimensions are greater than zero after adjusting for aspect
Resizing to zero can cause a bad viewport size error.

(cherry picked from commit ba3577f584)
2026-05-07 13:17:29 -04:00
cosmonaut
1ebe9161c3 GPU: Clarify VK_KHR_maintenance9 comment
(cherry picked from commit c8feb29746)
2026-05-07 10:00:07 -07:00
Susko3
5902d6622c Enable text editing events in checkkeys
(cherry picked from commit 2949a0d6d5)
2026-05-07 09:57:22 -07:00
Sam Lantinga
a730905a2b Fixed build
(cherry picked from commit ab19d09939)
2026-05-06 19:42:51 -07:00
Torbjorn Laedre
1704eb5e2e Change 3D texture memory barrier sub-resource range to be maintenance9 compatible.
(cherry picked from commit 5d63a4cad2)
2026-05-06 18:21:31 -07:00
Sam Lantinga
ef9963df0d Don't report 10% battery for Xbox controllers using XInput
(cherry picked from commit 386f198622)
2026-05-06 18:12:29 -07:00
Rachel Blackman
e1513e2d3c Ensure Android hidapi does not drop the report byte (#15527)
(cherry picked from commit f8c364ae74)
2026-05-06 16:08:32 -07:00
Ryan C. Gordon
1ee51f2d88 opengles2: Rework render targets.
Now this keeps one FBO for each SDL_TEXTUREACCESS_TARGET texture, and doesn't
reuse it. We check if the FBO is "complete" once, at creation time, and
setting a render target merely has to bind the right FBO and never look back.

This simplifies the code and removes a guaranteed pipeline stall when setting
a new render target.

Fixes #15524.

(cherry picked from commit 56e0d052f1)
2026-05-06 13:28:03 -04:00
Frank Praznik
9257b7bc13 wayland: Queue the surface frame callback after the initial commit
Some compositors may dispatch this too early, during the initial empty commit, when subsurfaces are attached to a toplevel window, but a buffer has yet to be committed to the parent surface. Don't set the frame callback until the initial empty commit is done, so it will be called when the actual parent surface frame is committed.

(cherry picked from commit e3393e6304)
2026-05-06 12:29:11 -04:00
Frank Praznik
68082c7d15 wayland: Unconditionally send an exposure event on window shown status
Some compositors send the frame callback as part of the initial configuration sequence, so the window may already be past the "waiting for frame" state. Ensure that the exposure event is always sent.

(cherry picked from commit 1ac0ae9224)
2026-05-05 18:33:14 -04:00
Anonymous Maarten
d34a306ea9 cmake/sdlcpu: detect mips
PlayStation Portable uses MIPS32

(cherry picked from commit 8effeecb8d)
2026-05-06 00:34:14 +03:00
Evan Hemsley
6b28e6870e GPU: D3D12 stencil plane transition (#15519)
(cherry picked from commit fee8c94b5c)
2026-05-05 12:55:33 -07:00
Frank Praznik
85ebd16fb2 x11: Disable the X Synchronization Extension by default
Under the right conditions, this extension can result is smoother resizing when rendering with OpenGL, however, it is known to cause problems in certain cases, such as when handling presentation externally.

Gate it behind a hint, and disable it by default. Developers can selectively enable it when they verify that they meet the criteria for using it, and that it behaves correctly in their apps/games.

(cherry picked from commit b8545fce54)
2026-05-05 13:51:41 -04:00
Sam Lantinga
05d8af1a75 Fixed rare cursor corruption on Windows
If the cursor was created with a temporary surface that was pointing at external memory, then when the cursor is used it might be referencing memory that had already been freed.

(cherry picked from commit f6f4664ed1)
2026-05-05 08:55:45 -07:00
Ryan C. Gordon
6d35168a63 thread: Remove semaphore in thread creation.
This was added so that the new thread definitely has its threadid set, via
SDL_GetCurrentThreadID(), before SDL_CreatThread returns, but this broke
Emscripten, which can't wait on a newly-created thread, since the thread won't
start until a later mainloop iteration.

Now we have the creating thread set this id in SDL_SYS_CreateThread, where
platform-specific logic can figure out how to calculate the new thread's ID
from the parent thread, without using SDL_GetCurrentThreadID().

Fixes #15509.

(cherry picked from commit 922b872b4f)
2026-05-05 00:54:08 -04:00
Nintorch
3013f975ac Fix JoyCon mappings on Android
(cherry picked from commit 3c1636a958)
2026-05-04 11:49:45 -07:00
Nintorch
52b6bceedf Add support for joystick motion sensors on Android
(cherry picked from commit c699512adc)
2026-05-03 15:11:59 -07:00
Frank Praznik
5c107908ff wayland: Pass the inverted flag for horizontal scroll events
Natural scrolling affects both axes, and the compositor may not send the vertical axis orientation if the frame has no vertical scroll motion, so purely horizontal events need to be flagged as inverted as well.

(cherry picked from commit 3ee0439ae5)
2026-05-03 17:45:46 -04:00
Nintorch
c239edd6e0 Fix Xbox controller names in MFI joystick backend (#15499)
controller.vendorName returns a generic name for Xbox controllers ("Controller"), so we have to give them proper names.

(cherry picked from commit c805a4d632)
2026-05-03 09:26:38 -07:00
Sam Lantinga
796782fc89 Updated to version 3.4.9 for development 2026-05-01 19:49:54 -07:00
Sam Lantinga
d9d5536704 Updated to version 3.4.8 for release release-3.4.8 2026-05-01 17:02:55 -07:00
Sam Lantinga
1d75b6bc59 Fixed crash on Windows when a controller is connected
(cherry picked from commit 4a52a5ee04)
2026-05-01 16:57:47 -07:00
Igor
2dbfe0ead9 X11TK: fix late null-check causing segfault
The code is using `controls.window` before checking if it isn't null.

I found this bug by accident when I tried to run `SDL_ShowSimpleMessageBox`.

It first tried using Wayland with `zenity`, but since I don't have `zenity`, it fallbacked to `X11_ShowMessageBoxImpl`.

For some reason it couldn't create a window, maybe something related to XWayland, so `controls.window` was `NULL`.

(cherry picked from commit e70f1bfc29)
2026-05-01 19:13:54 -04:00
Sam Lantinga
be6f1b74dc Updated to version 3.4.7 for development 2026-05-01 06:43:01 -07:00
Sam Lantinga
3aabb7bc53 Updated to version 3.4.6 for release release-3.4.6 2026-05-01 06:31:29 -07:00
Cameron Gutman
102bf22db8 haptic: Enable gamepad haptic support under sdl2-compat
(cherry picked from commit c677c913a6)
2026-04-30 21:17:56 -07:00
Sam Lantinga
65eda5fbd4 Fixed copyright on SDL_hidapi_steam_triton.c
Fixes https://github.com/libsdl-org/SDL/issues/15486
Closes https://github.com/libsdl-org/SDL/pull/15487

(cherry picked from commit e9a6d7eda0)
2026-04-30 19:56:07 -07:00
Cameron Gutman
ed70ce85c1 pen: Fix enabling touch emulation while a pen is connected
(cherry picked from commit 41f079491a)
2026-04-29 19:50:48 -05:00
Jakub Wasilewski
cc150bc566 metal: Added missing lock in METAL_INTERNAL_PerformPendingDestroys.
Without this lock, a concurrent call to SDL_ReleaseGPUBuffer, SDL_ReleaseGPUTransferBuffer or SDL_ReleaseGPUTexture can cause one of the arrays to be reallocated while METAL_INTERNAL_PerformPendingDestroys is iterating over it, causing a bad day all around.

(cherry picked from commit 1492911c7d)
2026-04-29 08:48:49 -07:00
Cameron Gutman
46f87cdc5a pen: Only create touch emulation device when a pen is present
(cherry picked from commit 1aa72247af)
2026-04-29 02:21:46 -04:00
Sam Lantinga
d7af22f927 Disable accidentally enabled debug logging
(cherry picked from commit e1e6cbe6ec)
2026-04-28 17:26:48 -07:00
Ryan C. Gordon
fbd792e4df android: Parsing the APK's central dir is separate from the AAssetManager.
Only parse when necessary, which it isn't when opening a file, so this is now
separated from creating the cached AAssetManager object.

(cherry picked from commit 9235ac4efd)
2026-04-28 20:25:19 -04:00
Ryan C. Gordon
79dacf6630 android: Use enough zip64 format info to see APKs with files that are > 4gb.
(cherry picked from commit 40e60452ad)
2026-04-28 20:25:10 -04:00
Ryan C. Gordon
46045ea060 android: Parse the APK directory tree, replace AAssetManager enum/getpathinfo.
The AAssetManager won't supply this information to us, but it's just a zip
file, so we can read its central directory ourselves. We can still use
AAssetManager for file i/o to the APK's assets, so we don't have to deal with
compression and other zipfile features.

Fixes #15220.
Reference Issue #15347.

(cherry picked from commit bb4332bdc2)
2026-04-28 20:25:05 -04:00
Sam Lantinga
3164b74256 Don't use the fake HID endpoint for Xbox controllers on Windows
(cherry picked from commit d5fca9628a)
2026-04-28 14:10:29 -07:00
Ryan C. Gordon
affc61cc5e checkkeys: Sleeping for 100ms every frame makes the program too unresponsive.
Makes it feel like there's a bug in SDL's text input handling. 10ms is fine.

(cherry picked from commit 7212ab1c2a)
2026-04-28 17:16:37 +03:00
Cameron Gutman
0013e9e1d3 atomic: Fix and cleanup SDL_UnlockSpinlock()
- Add missing SDL_MemoryBarrierRelease() in the generic codepath
- Remove MSVC x86/x64 case which is now identical to the generic codepath
- Fix Solaris barrier to ensure prior stores are visible before unlocking

(cherry picked from commit 95ae0c194e)
2026-04-27 19:42:39 -05:00
Cameron Gutman
22b5ceb0c7 atomic: Fix infinite recursion in SDL_CompilerBarrier() fallback
On some platforms, SDL_MemoryBarrierRelease() is defined to
SDL_CompilerBarrier(). If SDL_CompilerBarrier() is also defined to
the fallback spinlock acquire/release, then we will infinitely
recurse in SDL_UnlockSpinlock(). Avoid this by not unlocking the
temporary spinlock we create.

(cherry picked from commit 66e98b5598)
2026-04-27 14:31:09 -04:00
Sam Lantinga
259e4fe1a2 Fixed double-backspace with hardware keyboard on iOS
(cherry picked from commit b7726026f8)
2026-04-27 10:55:11 -07:00