Commit Graph

22234 Commits

Author SHA1 Message Date
Anonymous Maarten
f58cd8f26d ci: avoid brew creating noisy annotations 2026-07-01 18:11:49 +02:00
Anonymous Maarten
e07d149a2a ci: bump Ubuntu runner of Intel oneAPI 2026-07-01 18:11:49 +02:00
Anonymous Maarten
dd6f438efb Limit default search path of build-scripts/check_stdlib_usage.py 2026-07-01 18:11:49 +02:00
Ryan C. Gordon
774728b6ff audio: Pass the id, not the obj, to SDL_AudioDeviceDisconnected_OnMainThread.
If a device has disconnected, and the app has quit the audio subsystem before
the queued main thread function has run, the pointer will be bogus by the time
the run occurs. So now it looks up the object from its device ID, and if the
lookup returns NULL, it returns immediately and everything works out.

Reference Issue #14856.

(which might be fixed by this or not.)
2026-06-30 16:19:49 -04:00
Sam Lantinga
dfefce62e2 Get the physical device properties when using an external Vulkan device
Fixes `testffmpeg --sprites 100` when using the Vulkan renderer
2026-06-30 12:53:17 -07:00
Sam Lantinga
2069d5f6bc Fixed formatting 2026-06-30 12:53:17 -07:00
SDL Wiki Bot
4fe0d8c1cd Sync SDL3 wiki -> header
[ci skip]
2026-06-30 16:33:03 +00:00
Frank Praznik
b4b1cdeb27 wayland: Add support for the toplevel tag protocol
Uses the same ID string as the session manager protocol.
2026-06-30 12:30:08 -04:00
Frank Praznik
d8971fa00a wayland: Add support for the session management protocol
Add session management protocol support for saving/restoring toplevel window state across runs.
2026-06-30 12:30:08 -04:00
Sam Lantinga
464b90b475 Issue a batch when changing render targets in the Vulkan renderer
Otherwise we get rendering artifacts that look like drawing is being applied to the wrong render target
2026-06-30 09:00:09 -07:00
Frank Praznik
2f1cf4629c wayland: Fix incorrect dereference when sorting icon surfaces 2026-06-30 10:15:28 -04:00
Mason Remaley
a168e96cbc Fixes invalid dereference in animated cursor sort
`Wayland_CreateAnimatedCursor` calls `SDL_qsort` on an array of
type `**SDL_Surface`, not on an array of `*SDL_Surface`. As such the void
pointers in the callback need to be casted to `SDL_Surface **` not
`SDL_Surface *`.

This was likely not caught since it's very unlikely that reading a few
bytes past the end of this array results in reading unreadable memory,
so the only side effect was invalid sort results, which is a bit subtle.

I caught this because I build SDL with UBSAN enabled in my debug builds,
and it trapped when the multiplication of the garbage `SDL_Surface*`
width and heights overflowed. I validated that the change is correct by
adding logs (that have then since been removed) demonstrating that it
was previously comparing garbage, and is now comparing the actual cursor
surfaces.
2026-06-30 09:53:17 -04:00
Ozkan Sezer
79ae27bba1 update khronos headers from mainstream. 2026-06-30 03:37:47 +03:00
Sam Lantinga
e0b12bbcea Added a workaround for a crash in NVIDIA drivers when rendering YUV with Vulkan
Fixes https://github.com/libsdl-org/SDL/issues/13878
2026-06-29 14:09:24 -07:00
Sam Lantinga
92c3150859 Fixed OpenVR build 2026-06-29 13:14:33 -07:00
SDL Wiki Bot
9da5a636ad Sync SDL3 wiki -> header
[ci skip]
2026-06-29 17:51:17 +00:00
Andrei Sabalenka
7ee8160922 gpu: make NULL object releases no-ops
These functions already return immediately for NULL objects in normal builds, but it was done through CHECK_PARAM. When building with SDL_DISABLE_INVALID_PARAMS, these checks were compiled out, and NULL resources could reach backend release functions and cause segfault.

Always return on NULL so API behaves consistently regardless of SDL_DISABLE_INVALID_PARAMS.
2026-06-29 10:47:52 -07:00
Frank Praznik
0a8ccb11eb win32: Use the current cursor coordinates when processing WM_NCACTIVATE
The event coordinates returned by GetMessagePos() for WM_NCACTIVATE are out of date if the cursor moved while an overlay was active, and may indicate that the cursor is still in the window when it is not. Always use the current cursor coordinates when processing this message to avoid incorrectly setting mouse focus if the cursor is no longer within the window.
2026-06-29 12:38:17 -04:00
Sam Lantinga
f0e99e7c7f Removed unnecessary assert in WIN_SetWindowOpacity()
Fixes https://github.com/libsdl-org/SDL/issues/15896
2026-06-27 21:10:19 -07:00
BZL
111bb79bf8 Add Void GENESIS controller support
Add AndGAMER/Void Gaming USB IDs for Void GENESIS.

Recognize the Void GENESIS SInput VID/PID pair and set its device name.
Add DirectInput gamepad mappings for the wired and dongle DirectInput modes.
2026-06-27 20:11:44 -07:00
Cameron Gutman
32f460d357 keyboard: Limit text input event size for sdl2-compat 2026-06-27 17:34:26 -07:00
Ryan C. Gordon
8ee03d68bd README-migration: patched SDL_RWFromFP replacement code to compile.
Reference Issue #15893.
2026-06-27 16:57:17 -04:00
Ozkan Sezer
4bebbec9d4 update khronos headers from mainstream. 2026-06-26 21:32:02 +03:00
Holden Ramsey
7a6eed4ec8 Android: decouple video/audio subsystems from JNI initialization
Allow Android embedders to use SDL without the full video/audio Java
layer by gating subsystem-specific code behind SDL_VIDEO_DISABLED and
SDL_AUDIO_DISABLED preprocessor flags.

This enables applications that only need joystick/gamepad support
(e.g. Qt-based apps like QGroundControl) to build SDL without shipping
stub Java classes for unused subsystems.

Changes:
- Split SDLActivity JNI method table into core (lifecycle, hints,
  permissions) and video (surface, input, clipboard, orientation)
- Gate SDLAudioManager and SDLInputConnection JNI registration
- Make checkJNIReady() subsystem-aware: no longer requires
  mAudioManagerClass when SDL_AUDIO_DISABLED
- Group method ID resolution by subsystem in nativeSetupJNI()
- Guard all video/audio function implementations and declarations
- Keep display orientation accessors always available (needed by camera)
- Add subsystem-selective SDL.setupJNI(int)/initialize(int) to SDL.java
  with backwards-compatible zero-arg overloads
- Guard SDL_VIDEO_DRIVER_ANDROID and related defines in
  SDL_build_config_android.h
2026-06-26 10:59:54 -07:00
Frank Praznik
8554d1c23c time: Convert the PS2 time implementation to a dummy implementation
SDL has no dummy fallback for the RTC functions, and the PS2 implementation is just an empty dummy implementation, so rename it and build it if no system-specific time functionality is found.
2026-06-25 11:32:48 -04:00
Ryan C. Gordon
9f4327068e pipewire: Don't set a specific stream name if the node name is the same.
Fixes #15746.
2026-06-25 10:39:20 -04:00
Frank Praznik
607eb5206e cmake: Print a warning if the libdecor development library is missing
libdecor is required for window decorations on Wayland when the toplevel decoration protocol is not supported, such as on GNOME and Weston. Warn if the development library can't be found, unless it was explicitly disabled.
2026-06-25 09:46:45 -04:00
bubbleguuum
f1f4d0d229 Fix opening pipewire device blocking indefinitely if no device
If wireplumber is not running or if there is no audio device,
PIPEWIRE_OpenDevice could remain stuck indefinityely on PIPEWIRE_pw_thread_loop_wait
because priv->stream_init_status is never equal to PW_READY_FLAG_ALL_PREOPEN_BITS.
Use PIPEWIRE_pw_thread_loop_timed_wait instead with a 2 seconds timeout and bail
out with an error on timeout.
A 2 seconds timeout seems plenty enough: in my observations, when there is an audio device,
the wait for the device to be ready is just a few milliseconds.
2026-06-25 09:41:15 -04:00
SDL Wiki Bot
0fa422231d Sync SDL3 wiki -> header
[ci skip]
2026-06-24 19:48:34 +00:00
Sam Lantinga
089b862732 Added SDL_HINT_WINDOWS_RAW_MOUSE_NOLEGACY 2026-06-24 12:45:36 -07:00
Bartłomiej Dach
9acf54142e iOS: Fix crash on pinch gesture
Related: 65091012b4

After the aforementioned commit, pinching in any iOS app using SDL
crashes with

	*** Terminating app due to uncaught exception 'NSRangeException', reason: '-[UIPinchGestureRecognizer locationOfTouch:inView:]: index (1) beyond bounds (1).'
	*** First throw call stack:
	(0x19d31a23c 0x199de9224 0x19d37fec4 0x1a3f99bf0 0x1a3fa3c68 0x103277370 0x1a33b8b7c 0x1a33b848c 0x1a33b8238 0x1a2efc9a4 0x1a2ec1310 0x1a8ab8754 0x1a8af6c1c 0x1a8abc324 0x1a8ac79f4 0x1a2f010e8 0x1a2ee9550 0x1a2efd638 0x1a2eea040 0x1a2f0318c 0x1a2eecd48 0x1a2f062a8 0x1a2f03834 0x2b210f56c 0x19d2a5358 0x19d2a52cc 0x19d26a5a8 0x19d2341a0 0x19d23354c 0x1032bcdd8 0x1032ee2a0 0x1032ee3fc 0x1032ee360 0x102280644 0x10228042c 0x1033cd0cc 0x1032a8198 0x19a61f5dc 0x19d273960 0x19d273658 0x19d2731cc 0x19d234584 0x19d23354c 0x24299f498 0x1a2f2c244 0x1a2e97158 0x1032a5780 0x102280030 0x199e41c1c)
	libc++abi: terminating due to uncaught exception of type NSException

As it turns out, `UIPinchGestureRecognizer` does not guarantee the
presence of two touches throughout the entire duration of the pinch.
When the user is releasing the touches that constitute the pinch
gesture, more often than not they will release one touch before the
other. When this happens, `UIPinchGestureRecognizer` *does not terminate
the pinch*, but continues updating it, only with one touch remaining in
the gesture. The gesture is only marked concluded when the user releases
*both* touches.

To prevent the crash, check that the second touch is actually available
via the `numberOfTouches` property. If it is not, avoid emitting
`SDL_EVENT_PINCH_UPDATE` events to prevent sending unexpected payloads
downstream; there is no second touch to use anymore to calculate
`(focus|span)_(x|y)`.
2026-06-24 10:28:07 -07:00
Bartłomiej Dach
df65a2385d Fix Xcode project not building due to missing header
Both `SDL3/SDL.h` and `SDL3/SDL_events.h` attempt to `#include
<SDL3/SDL_notification.h>` and that header was not added to Xcode,
leading to compilation failures.
2026-06-24 10:28:07 -07:00
Ryan C. Gordon
179e66f1fe docs: Improved SDL_CommonEvent documentation. 2026-06-24 13:15:53 -04:00
SDL Wiki Bot
135a9457f3 Sync SDL3 wiki -> header
[ci skip]
2026-06-23 18:34:01 +00:00
Frank Praznik
5471f4c3de notification: Fix old function names in documentation 2026-06-23 14:31:01 -04:00
Frank Praznik
a7ade74cf1 notification: Check the icon string before duplicating
Fixes #15877
2026-06-23 14:28:17 -04:00
Ryan C. Gordon
0b692f64b0 docs: warn not to destroy an SDL_AudioStream during its callback.
Fixes #15871.
2026-06-23 13:49:46 -04:00
Sam Lantinga
7be5990089 Removed redundant check for VK_SUCCESS
Fixes https://github.com/libsdl-org/SDL/issues/15157
2026-06-23 08:59:16 -07:00
Sam Lantinga
284afc2c9a Set SDL_PROP_TEXTURE_GPU_TEXTURE_V_POINTER to the correct texture
Fixes https://github.com/libsdl-org/SDL/issues/15157
2026-06-23 08:57:49 -07:00
Frank Praznik
e26370810b gpu/vulkan renderer: Reconfigure the window on renderer creation if it has the OpenGL flag
In some cases, conflicts can occur at the platform or driver level if a window initially configured for OpenGL is then used with a Vulkan-based renderer. Try to reconfigure or recreate the window in the unlikely event that it has the OpenGL flag set when initializing the Vulkan or GPU renderer to remove any platform or driver-specific OpenGL objects and properties.
2026-06-23 11:03:05 -04:00
Sam Lantinga
a45ef5dc64 Added RIDEV_NOLEGACY to improve performance in mouse relative mode (thanks @whrvt!)
This change also makes it so relative mode doesn't kick in until the mouse enters the window client area. This prevents relative mode from kicking in while clicking and dragging on the title bar, etc.
2026-06-23 07:10:25 -07:00
SDL Wiki Bot
e300b87e35 Sync SDL3 wiki -> header
[ci skip]
2026-06-23 07:25:14 +00:00
SDL Wiki Bot
1a21db244c Sync SDL3 wiki -> header
[ci skip]
2026-06-23 02:18:50 +00:00
Ryan C. Gordon
4f778d56fd .wikiheaders-options: Fix Notification category. 2026-06-22 22:17:12 -04:00
Ryan C. Gordon
c1918f0817 docs: SDL_Locale is a struct, not a function. 2026-06-22 22:13:21 -04:00
Sam Lantinga
07ecc125cf Added SDL_PIXELFORMAT_P408 and SDL_PIXELFORMAT_P416 2026-06-22 17:01:54 -05:00
SDL Wiki Bot
0bb539314d Sync SDL3 wiki -> header
[ci skip]
2026-06-22 03:32:20 +00:00
Brent Page
65091012b4 Add more information for pinch gestures on mobile (#15092) 2026-06-21 20:30:50 -07:00
SDL Wiki Bot
941dda1ccd Sync SDL3 wiki -> header
[ci skip]
2026-06-21 18:52:43 +00:00
Semphriss
e52dbf4442 Add basic Ubuntu Touch functions #12543
This adds support for:
* System theme
* Sandbox detection
* Device form factor detection

Many things aren't properly supported yet, but changes and upgrades will happen on the Ubuntu Touch side, so SDL should automatically support more Ubuntu Touch features as time goes.
2026-06-21 11:51:15 -07:00