Commit Graph

19585 Commits

Author SHA1 Message Date
Sam Lantinga
cdff4b2bb5 Completed removing predefined Xbox 360 mappings for Linux
Also removed them for OpenBSD, since it's not clear which ones, if any, are needed.

(cherry picked from commit b305534edc)
2025-11-14 07:20:17 -08:00
Dave Wickham
d3a1a97db8 Re-add deleted gamepad mappings to the OpenBSD-specific section
(cherry picked from commit f6c3af9c8c)
2025-11-14 07:20:16 -08:00
Dave Wickham
962464629d Remove special-case Xbox 360 wireless controller mappings
Fixes https://github.com/libsdl-org/SDL/issues/14324

(cherry picked from commit 0c4c4cfd16)
2025-11-14 07:20:16 -08:00
Sam Lantinga
3291c2e560 Check for wine_get_version() to detect Wine/Proton
If this application is being run under Wine but Steam doesn't know that, Steam won't set STEAM_COMPAT_PROTON. So we'll use wine_get_version() to detect that we're running under Wine instead.

(cherry picked from commit e2e8f86076)
2025-11-12 22:30:48 -08:00
Sam Lantinga
b797a84b5d Don't check SteamVirtualGamepadInfo when running as Wine
Wine will ignore the Steam Virtual Gamepad if it looks like it has the original (blocked) controller VID/PID.

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

(cherry picked from commit 493bc621e4)
2025-11-12 22:30:48 -08:00
Marcin Serwin
45b0460019 Don't divide by zero in slow blitter
Other blitters seem to handle zero width/height destinations correctly.

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
(cherry picked from commit 53ee410d7a)
2025-11-09 07:26:37 -08:00
Chris Genova
5d0919855e D3D12 GPU: Prevent reading out of bounds when uploading textures.
When the upload needs realignment, a new buffer is created to do the
upload, and the source data is copied to the new buffer. This commit
fixes the issue where the memcopy can read off the end of the source
buffer since it is reading based on destination pitch instead of source
pitch.

(cherry picked from commit 6a01d6e7d3)
2025-11-07 17:50:25 -08:00
Sam Lantinga
6d2d283954 Fixed blitting bitmaps with a non-zero x offset
Also added basic testautomation coverage of bitmap blits

Fixes https://github.com/libsdl-org/sdl2-compat/issues/546

(cherry picked from commit a2ed1a4197)
2025-11-06 22:49:17 -08:00
Frank Praznik
49db06b604 x11: Only correct placement for border offset on the initial window mapping
Correcting it when it is subsequently hidden and re-mapped will cause the position to be double offset by the size of the borders.

(cherry picked from commit a71b2f0a93)
2025-11-06 19:35:51 -05:00
yuanhecai
85012b6074 loongarch: add SDL_FillSurfaceRect4LSX opt
(cherry picked from commit dc5b136930)
2025-11-06 07:29:51 -08:00
yuanhecai
14271c72f3 loongarch: add Blit8888to8888PixelAlphaSwizzleLSX opt
(cherry picked from commit 0b1eb4c841)
2025-11-06 07:29:50 -08:00
Sam Lantinga
d73922e407 Validate SPI read command in the Nintendo Switch HIDAPI driver
(cherry picked from commit c94da8977d)
2025-11-05 17:35:02 -08:00
Sam Lantinga
c8d23a5f01 Fixed unaligned access in the Nintendo Switch HIDAPI driver
(cherry picked from commit 9a1745f2c8)
2025-11-05 17:08:50 -08:00
Yevgen Abramov
4d8c8cdeda Fix V4L2 frame rate numerator comparison in SDL3 camera
Signed-off-by: Yevgen Abramov <eabramov84@gmail.com>
(cherry picked from commit b09b557fc6)
2025-11-05 10:56:25 -08:00
Anonymous Maarten
148d8c4995 release: don't download pre-release dependencies + strict version parsing
(cherry picked from commit 0da649eb72)
2025-11-04 18:00:48 +01:00
Sam Lantinga
4ae517e24e Removed redundant wait at shutdown in the ALSA audio driver
(cherry picked from commit 97e2951875)
2025-11-02 18:30:35 -08:00
Sam Lantinga
1fd4703907 Save a copy of the D3D12 semantic string
Fixes https://github.com/libsdl-org/SDL/issues/14383

(cherry picked from commit 4db63e323e)
2025-11-02 18:11:23 -08:00
Anonymous Maarten
024221d448 release: sync scripts with main branch
[ci skip]
2025-11-03 00:11:55 +01:00
Sam Lantinga
bfe046b60f Clamp the audio drain delay to 100 ms
Fixes https://github.com/libsdl-org/SDL/issues/9829

(cherry picked from commit 0882623092)
2025-11-02 11:16:13 -08:00
Sam Lantinga
1bfa90cb1f Fixed the paddle mapping for Steam Controllers
Fixes https://github.com/libsdl-org/SDL/issues/14380

(cherry picked from commit 3336aa95f1)
2025-11-02 10:07:42 -08:00
bleeqer
0c2e3308a5 Fix NULL pointer dereference in SDL_GlobStorageDirectory
(cherry picked from commit fc6f97f162)
2025-11-02 08:56:14 -08:00
Sam Lantinga
11fc77b704 Fixed the right touchpad calculation for the BLE Steam Controller
Fixes https://github.com/libsdl-org/SDL/issues/14368

(cherry picked from commit eb87a36940)
2025-11-02 08:31:59 -08:00
Arkadiusz Hiler
28af0d58c6 pulseaudio: Match channel map to SDL's chosen order
pa_channel_map_init_auto() with PA_CHANNEL_MAP_WAVEEX does the wrong
thing as it just takes the lest significant bits of
WAVEFORMATEXTENSIBLE's dwChannelMask in order. This doesn't match SDL's
chosen channel ordering.

The implementation here mirrors what we do for PipeWire.

(cherry picked from commit 0d2f081d41)
2025-10-30 13:33:46 -07:00
Sam Lantinga
bca544448f Updated to version 3.2.27 for development 2025-10-30 10:18:08 -07:00
Sam Lantinga
badbf8da4e Added some missing changes from main for the Android release build release-3.2.26 2025-10-30 09:52:18 -07:00
Sam Lantinga
b140291cd0 Updated to version 3.2.26 for release 2025-10-30 09:10:42 -07:00
Sam Lantinga
70b12c1b1b Check to see if joysticks are actually initialized in SDL_UpdateJoysticks()
Fixes https://github.com/libsdl-org/SDL/issues/14362

(cherry picked from commit c21b7f8cb8)
2025-10-30 08:54:53 -07:00
Simon McVittie
2bbd74b4b6 wayland: Fix compile with libdecor 0.2 and SDL_WAYLAND_LIBDECOR_SHARED=OFF
libdecor 0.3, which changes the signature of libdecor_new and
libdecor_decorate to use a const pointer to the interface struct, has
not yet been released. In the latest release, libdecor 0.2.4, the
interface struct is a mutable pointer.

This doesn't affect typical upstream builds with
SDL_WAYLAND_LIBDECOR_SHARED=ON, in which case we're casting a pointer
returned by dlsym(); but Linux distributions that want tighter control
over dependencies often prefer to link them in the normal way, in which
case the build will fail if the signature doesn't match.

Fixes: 33834360 "wayland: Fix libdecor incompatible pointer types"
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 8b64dd67d2)
2025-10-30 07:14:49 -07:00
Sam Lantinga
add176e538 Make sure we don't allocate a TLS ID clobbering an application defined one
Fixes https://github.com/libsdl-org/SDL/issues/14359

(cherry picked from commit d9ca0457b5)
2025-10-29 14:06:11 -07:00
Sam Lantinga
86384afbcf Fixed the right shoulder button on the 8BitDo Pro 3
(cherry picked from commit cecf4b0d4e)
2025-10-28 14:55:36 -07:00
Sam Lantinga
328f833d51 Added a Linux mapping for the 8BitDo Pro 3
(cherry picked from commit 78f9cb44c3)
2025-10-28 14:14:00 -07:00
Frank Praznik
a002a6313e wayland: Fix libdecor incompatible pointer types
(cherry picked from commit 3383436068)
2025-10-28 13:43:46 -04:00
Sam Lantinga
4fc5405f16 Fixed trying to grab the mouse when losing keyboard focus
Fixes https://github.com/libsdl-org/SDL/issues/14350

(cherry picked from commit 2d14a237dc)
2025-10-28 08:20:17 -07:00
Albin Johansson
16d9f7316f Use cast operators in headers to avoid warnings
This avoids compiler warnings when consuming the
headers from C++.

(cherry picked from commit 7381a2b072)
2025-10-25 20:11:48 -07:00
Sam Lantinga
95977f41b7 Perform full rectangle intersection for empty rects
If we don't do that, we leave the x and y values uninitialized.

Fixes https://github.com/libsdl-org/sdl12-compat/issues/365

(cherry picked from commit ffd0ca4391)
2025-10-25 13:50:32 -07:00
DONGGEUN YOO
3302162ede Fix uninitialized length in X11_GetClipboardData causing test failures (#14322)
(cherry picked from commit 093fbfd867)
2025-10-25 07:42:24 -07:00
Sam Lantinga
29f857fed6 Removed SDL_FILE from source code
(cherry picked from commit a402af506c)
2025-10-22 11:11:31 -07:00
Sam Lantinga
492ed877ea Removed __FILE__ from source code
(cherry picked from commit f79ede100b)
2025-10-22 10:49:31 -07:00
Sam Lantinga
b1959ecf23 Be more selective when blacklisting controller touchpads
On Android, the PS4 controller is called "Wireless Controller Touchpad"
Fixes https://github.com/libsdl-org/SDL/issues/14294

(cherry picked from commit 999f782ad3)
2025-10-22 10:45:34 -07:00
Anonymous Maarten
928454cbfe cmake: fix typo
INTERFACE_COMPILE_COMPILE_OPTIONS -> INTERFACE_COMPILE_OPTIONS

(cherry picked from commit c5b0187fc9)
2025-10-22 19:01:17 +02:00
Katelyn Gadd
36b306a36c If VULKAN_Submit fails during VULKAN_INTERNAL_CreateTexture, destroy the texture and return NULL
(cherry picked from commit 9479ac039c)
2025-10-20 16:24:32 -07:00
Sylvain
92570af7d3 Fixed bug #14233 - Android fix Android_WaitActiveAndLockActivity() to make sure Android_Paused state is refreshed
(cherry picked from commit e4c60c05bf)
2025-10-19 07:44:15 -07:00
Peter0x44
5a9050aea3 Make D3D math functions static inline to reduce likelihood of linking conflicts
Convert SDL_d3dmath.c functions to static inline in SDL_d3dmath.h to make
it less likely to conflict when static linking SDL. raylib's SDL backend
does not work with a "normal" upstream binary static link. It has these
errors:

/usr/bin/ld: /usr/local/lib64/libSDL3.a(SDL_d3dmath.c.o): in function `MatrixIdentity':
SDL/src/render/SDL_d3dmath.c:35: multiple definition of `MatrixIdentity'; CMakeFiles/raylib.dir/rcore.c.o:rcore.c:(.text+0x18470): first defined here
/usr/bin/ld: /usr/local/lib64/libSDL3.a(SDL_d3dmath.c.o): in function `MatrixMultiply':
SDL/src/render/SDL_d3dmath.c:44: multiple definition of `MatrixMultiply'; CMakeFiles/raylib.dir/rcore.c.o:rcore.c:(.text+0x18540): first defined here
collect2: error: ld returned 1 exit status

It works if these functions aren't emitted, (i.e.
!SDL_VIDEO_RENDER_D3D(11|12|GPU|VULKAN)

Or, if SDL is not linked static. Which I know is preferred anyway.

In raylib's case, it doesn't use this code anyway so it's not a problem
to build it yourself with them disabled. But it's a minor hassle to be
incompatible with static linking libraries from upstream.

I can't see any good reason for these functions to not be static inline
already, so I just put them in the header and deleted the .c.

Raylib's conflicting case is a library with a public function exposed to
users. But SDL's case is not.

- Moved all matrix functions from SDL_d3dmath.c to SDL_d3dmath.h as static inline
- Removed SDL_d3dmath.c from all project files (Visual Studio and Xcode)
- Functions affected: MatrixIdentity, MatrixMultiply, MatrixScaling,
  MatrixTranslation, MatrixRotationX, MatrixRotationY, MatrixRotationZ

(cherry picked from commit 705ced8cf5)
2025-10-14 16:58:04 -07:00
Oleksandr Manenko
3d9f4c3328 Fix thread safety attributes for TryLock functions
Changed SDL_TRY_ACQUIRE and SDL_TRY_ACQUIRE_SHARED success value
from 0 to true for functions that now return bool instead of int.
This fixes false positives/negatives in Clang's thread safety analysis.

(cherry picked from commit 901173aee6)
2025-10-14 12:47:58 -07:00
Sam Lantinga
04ceb2d4a0 Only pass UIPress from game controllers and remotes if the're not open
Fixes https://github.com/libsdl-org/SDL/issues/14080

(cherry picked from commit f844f3e10b)
2025-10-14 12:44:23 -07:00
Sam Lantinga
e6987e2452 Fixed emulated touch on Android
This also fixes laser pointer input on Meta Quest headsets

(cherry picked from commit 712ce16469)
2025-10-14 08:40:58 -07:00
Sam Lantinga
4cd6df1997 Added the 8BitDo Ultimate 2C Wireless Controller to the Xbox controller list
Fixes https://github.com/libsdl-org/SDL/issues/14127

(cherry picked from commit 98944ecd0c)
2025-10-13 18:48:05 -07:00
Evan Hemsley
9163913305 GPU: Correctly recycle D3D12 descriptor heaps (#14234)
(cherry picked from commit 20206b8e66)
2025-10-13 13:00:38 -07:00
cosmonaut
b3f4ba0725 GPU: Validate that buffer size is at least 4 bytes
(cherry picked from commit b067dfa345)
2025-10-13 11:07:22 -07:00
Brenton Bostick
354bda8dde fill-in missing DeleteLocalRef calls
(cherry picked from commit e584d2a8a9)
2025-10-13 09:28:44 -07:00