Commit Graph

12458 Commits

Author SHA1 Message Date
Simon McVittie
e8aa9551cb test: Don't expect a specific error message
SDL3 + sdl2-compat doesn't give precisely the same error message as
"classic" SDL2 here. To facilitate the transition from "classic" SDL2
to sdl2-compat, allow either one. This allows the "classic" SDL2 test
suite to be run against sdl2-compat, demonstrating that sdl2-compat is
indeed compatible with the version that it's replacing.

Signed-off-by: Simon McVittie <smcv@debian.org>
(cherry picked from commit c795b08567)
2025-12-29 10:05:54 -08:00
Sam Lantinga
95ba5679ef Added a Linux mapping for the Nacon GC100 controller (thanks @elkabyliano!)
(cherry picked from commit d10fe8bf2f)
(cherry picked from commit 13db7f049a)
2025-12-29 09:47:50 -08:00
Peppersawce
f21394381b Make BUrl not 'ambiguous'
(cherry picked from commit bacfd3c252)
2025-12-10 08:32:55 -08:00
PulkoMandy
843345a18c Use a BHandler attached to the application instead of a BLooper
When there is already a BApplication, SDL cannot start its own. In a
previous version, it instead started a separate looper. This results in
some extra complexity as there is now yet another thread to manage (in
addition to the main thread, the application thread, and the window
threads).

Instead, create a BHandler and attach it to the existing BApplication,
which allows it to receive messages in the already existing application
thread.

(cherry picked from commit 47312cf0f3)
2025-12-10 08:32:55 -08:00
Sam Lantinga
4478ad67d2 Lock joysticks when they are connected/disconnected on emscripten
Fixes https://github.com/libsdl-org/SDL/issues/11499

(cherry picked from commit 0281071243)
(cherry picked from commit d9836d15e7)
2025-12-08 21:01:47 -08:00
Cameron Gutman
667e4e9020 egl: Fix X11 EGL window creation on Nvidia
This is a port of 808a3f5 to SDL2.

Fixes #13094

(cherry picked from commit 3146374e4a)
2025-12-05 23:20:45 -06:00
Ozkan Sezer
2430122b21 alsa: fix signature of snd_pcm_hw_params_get_rate()
Reference issue: https://github.com/libsdl-org/SDL/issues/13845.
2025-12-03 21:40:32 +03:00
Joshua Root
18c96e27d2 Guard use of @available in SDL_cocoaevents.m
Older compilers don't understand this syntax.

(cherry picked from commit eb974470ec)
2025-12-03 10:04:26 -05:00
vanfanel
0dcfa78be6 SDL2: Fill the SDL_AudioSpec in add_device()
(cherry picked from commit 34691de22b)
2025-12-03 10:02:20 -05:00
Cameron Gutman
c636332031 quit: don't call signal() if we're using sigaction()
At best, this is a no-op.

At worst, it might:
 - Clobber a signal handler someone registered after us
 - Overwrite the signal mask or flags
 - Cause unregistration to fail (sigaction() isn't guaranteed to return the exact pointer passed to signal())

(cherry picked from commit 1d852d1c28)
2025-12-01 19:46:00 -06:00
Sam Lantinga
385e995790 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)
(cherry picked from commit f36d683b61)
2025-11-12 23:09:35 -08:00
Sam Lantinga
a069ac41e5 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)
(cherry picked from commit 5bdf7bc625)
2025-11-12 23:09:35 -08:00
Ozkan Sezer
dc086d6454 Revert "pipewire: disable -Wdeclaration-after-statement for pipewire headers"
This reverts commit 876baf6b0e.

Issue in pipewire release candidate 1.5.81 has been resolved in 1.5.82

Reference issue: Fixes: https://github.com/libsdl-org/SDL/issues/14343
2025-11-06 19:55:55 +03:00
yuanhecai
1acc405bd4 loongarch: add SDL_FillRect4LSX opt
(cherry picked from commit 14eebdab3c)
2025-11-06 07:29:07 -08:00
yuanhecai
a07b00ccb0 loongarch: add BlitRGBtoRGBPixelAlphaLSX opt
(cherry picked from commit 686c18026b)
2025-11-06 07:29:07 -08:00
Sam Lantinga
e458305c43 Clamp the audio drain delay to 100 ms
Fixes https://github.com/libsdl-org/SDL/issues/9829

(cherry picked from commit 0882623092)
(cherry picked from commit 6db23faa44)
2025-11-02 11:20:55 -08:00
Sam Lantinga
3ff58bf062 Don't consider USB devices which have already been skipped
Fixes https://github.com/libsdl-org/SDL/issues/14367

(cherry picked from commit 6570d9e23f)
2025-11-02 09:25:43 -08:00
Sam Lantinga
7eb78c5070 Fixed the right touchpad calculation for the BLE Steam Controller
Fixes https://github.com/libsdl-org/SDL/issues/14368

(cherry picked from commit eb87a36940)
(cherry picked from commit 2bb0eb4641)
2025-11-02 08:34:41 -08:00
Petar Popovic
6e5cad8e1e Fix leak in SDL_GameControllerTypeForIndex()
(cherry picked from commit 398bacbac3)
2025-11-01 08:40:37 -07:00
Ozkan Sezer
876baf6b0e pipewire: disable -Wdeclaration-after-statement for pipewire headers
Fixes: https://github.com/libsdl-org/SDL/issues/14343

(cherry picked from commit f9435eab16)
2025-11-01 00:45:32 +03:00
Ozkan Sezer
c0d0b31d1c SDL_kmsdrmvideo.c: fix build in C90 mode
(cherry picked from commit 00d4f1c2c4)
2025-10-26 04:35:40 +03:00
Sam Lantinga
80cbc908a1 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)
(cherry picked from commit 1c19bee000)
2025-10-25 13:52:34 -07:00
Frank Praznik
735d8a2dc8 wayland: Special-case relative warp mode to deliver accelerated relative motion
The Wayland backend lacks pointer warp functionality, so special-case the relative warp mode hint to deliver accelerated relative motion deltas, which is ultimately what the client wants by enabling this hint.

(cherry picked from commit 235e4870af)
2025-10-09 11:29:12 -04:00
AL2009man
bc67702d8d Disable SDL_HINT_JOYSTICK_RAWINPUT by default
backported from SDL3 commit aa870d5

 Fixes #13047

(cherry picked from commit 8ef0a07a52)
2025-10-08 11:35:46 -07:00
Ozkan Sezer
40625e9e7e ci: bump cross-platform-actions.
(cherry-picked from commit 97c1df66a8)
2025-10-07 14:28:50 +03:00
Brad Smith
a5f445dba1 Use elf_aux_info() on OpenBSD
NFC for ARMv7. For PowerPC move elf_aux_info() to higher priority over
sysctl for newer systems.

(cherry picked from commit b299e0de46)
(cherry picked from commit 641201a99a)
2025-09-27 09:01:58 -07:00
Fierelier
f172ee3d0e [SDL3] [PS2] Framebuffer resolution + 240p/480p + PAL support (#13993)
* Do not override NTSC/PAL

* Fix PS2 build instructions

* Add PS2 GS hints
Allows for switching between NTSC/PAL, progressive/interlaced, etc

(cherry picked from commit 3fd0b46215)
(cherry picked from commit 7b28fb29bd)
2025-09-26 08:26:29 -07:00
Sam Lantinga
7fe49da380 Removed UWP workflow from CI
The GitHub runners no longer have the needed SDK for this

(cherry picked from commit ecb72142fd)
2025-09-19 08:34:09 -07:00
krnl32
0efcafc74d Added a default case to the switch statement in the HEADER FILE to prevent compiler warnings about missing defaults. This change helps avoid compilation breaks when warnings are treated as errors.
(cherry picked from commit 9859c05178)
2025-09-16 17:17:42 -07:00
Ozkan Sezer
dcc72b43ba fix build.
(cherry picked from commit 07c3b3fb7c)
2025-09-15 20:30:20 +03:00
Ozkan Sezer
b8430e4135 SDL_endian.h: don't add _m_prefetch hack for clang-cl if available as a builtin
Fixes: https://github.com/libsdl-org/SDL/issues/13952 .

(backport from SDL3 commit 81f2f44843)
(cherry picked from commit 9343246616)
2025-09-15 20:11:10 +03:00
Sam Lantinga
394d9bfa1a Remove Windows 32-bit ARM build from CI
This architecture is deprecated and is now failing with:
Windows SDK 10.0.22621.0 : 'C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um' not found or was incomplete

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

(cherry picked from commit cc3274b6f1)
(cherry picked from commit b55059b487)
2025-09-14 18:03:32 -07:00
Sam Lantinga
ecc71c02ea Only use a transparent cursor on Windows when connected via RDP
VMware relies on the cursor being set to NULL to optimize relative mouse motion for games.

We should also revisit whether current RDP works better with a NULL cursor or a transparent cursor.

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

(cherry picked from commit dac6af4ba6)
(cherry picked from commit 55b599d693)
2025-09-14 17:32:38 -07:00
Gianfranco Berardi
60515350ae Provide Android targetsdk 35 support in SDL2 (#13776)
(cherry picked from commit be6ab7f9a6)
2025-09-13 07:19:52 -07:00
Ozkan Sezer
05c9b16183 alsa: fix signature of snd_pcm_info_free
Reference issue: https://github.com/libsdl-org/SDL/issues/13845.
2025-09-02 17:02:28 +03:00
Sam Lantinga
2db8436d8c Updated to version 2.32.11 for development 2025-09-01 15:12:02 -07:00
Sam Lantinga
5d24957039 Updated to version 2.32.10 for release release-2.32.10 2025-09-01 14:33:27 -07:00
Ozkan Sezer
fd5dcfba03 openslES: really fix build..
(cherry picked from commit d2ab01b8bb)
2025-09-01 20:38:56 +03:00
Ozkan Sezer
5806036c68 openslES: fix build
(cherry picked from commit f5246d0181)
2025-09-01 20:25:50 +03:00
Ryan C. Gordon
9f369a1736 openslES: OpenSL ES on Android only supports two formats, limit to that.
(Three with the floating point extension, which we use.)

This is according to:

https://developer.android.com/ndk/guides/audio/opensl/opensl-for-android

Previously, this would accept a request for Sint8 or Sint32 and disaster
would ensue.

Fixes #13779.

(cherry picked from commit 0b2a003a35)
(cherry picked from commit 7323104f97)
(cherry picked from commit b8c802632b)
2025-09-01 11:38:54 -04:00
Ozkan Sezer
1f6e0e3a23 regenerate configure script. 2025-08-31 20:20:50 +03:00
Gleb Mazovetskiy
c8e984701e configure.ac: Fix AC_DEFINE HAVE_LIBUSB
Fixes an error with autoconf 2.72

(cherry picked from commit 5ed21d1ccb)
2025-08-31 09:38:27 -07:00
Ozkan Sezer
2a506c8778 SDL_hidapi.c: fix -Wundef failures due to HAVE_DRIVER_BACKEND check
(cherry picked from commit 7a34e14c8e)
2025-08-30 15:47:40 +03:00
Ozkan Sezer
a455f023c2 CI: add OpenBSD workflow
(backported from commit c0e5fd55d2)
(cherry picked from commit 1a8e667f3d)
2025-08-30 15:47:20 +03:00
Frank Praznik
2a10b8c4e7 wayland: Add a sigtimedwait() implementation for OpenBSD
sigtimedwait() is an optional part of POSIX.1-2001, and OpenBSD doesn't implement it. Add a replacement implementation based on https://comp.unix.programmer.narkive.com/rEDH0sPT/sigtimedwait-implementation

(backported from commit 1049426a76)
(cherry picked from commit d31d98d436)
2025-08-30 15:47:00 +03:00
Ozkan Sezer
f610a3d66b update config.guess and config.sub from git://git.sv.gnu.org/config.git
(cherry picked from commit 56d43ee296)
2025-08-28 11:25:30 +03:00
Sam Lantinga
54772f345a Support the "ambient" value for SDL_HINT_AUDIO_CATEGORY
Fixes https://github.com/libsdl-org/SDL/issues/13732

(cherry picked from commit 4725213eef)
(cherry picked from commit 5e85a29e75)
2025-08-12 09:55:27 -07:00
Sam Lantinga
e257904eb3 Revert "autotools, android: Support Google Play 16 KB Page Size Requirement"
This reverts commit 9f1cc301a7.

If you need to support the Google Play 16 kiB page size requirement, the recommendation is to use NDK r28c or newer, which automatically aligns binaries correctly.
2025-08-07 11:37:57 -07:00
Sam Lantinga
cc7a73e727 Revert "Support Google Play 16 KB Page Size Requirement (#13470)"
This reverts commit e321995244.

If you need to support the Google Play 16 kiB page size requirement, the recommendation is to use NDK r28c or newer, which automatically aligns binaries correctly.
2025-08-07 11:37:44 -07:00
Ozkan Sezer
9f1cc301a7 autotools, android: Support Google Play 16 KB Page Size Requirement
autotools port of commit 4b2aa3f102.

cherry picked from commit e7489a0931
2025-08-07 20:10:28 +03:00