22825 Commits
Author SHA1 Message Date
Sam Lantinga d8c0bd465e Fixed keyboard focus on visionOS
On visionOS it's possible for the Swift ornaments to become key. In this case we want the SDL window to stay focused.
2026-10-27 13:10:55 -07:00
fyt000 4c18c09ea5 Fix gles2 program cache tail bug 2026-10-27 12:11:41 -04:00
Frank Praznik e9b4979718 test: Add a lazy redraw mode to testdrawchessboard
This only redraws when exposure events are sent, which is useful for testing that exposure events are always sent at the appropriate times.
2026-10-27 10:28:05 -04:00
Frank Praznik 1e2f380017 wayland: Don't delay toplevel acks when resizing
Compositors generally prefer that configuration changes are acked immediately, even if not every ack accompanies a commit.
2026-10-27 10:28:02 -04:00
Ryan C. Gordon b80368fee8 video: Add a "VideoPreQuit" method, move Windows hotplug shutdown to it.
This prevents the thread from adding devices after the rest of the video
subsystem has gone down. Now the thread is gone before that.

Fixes #16437.
2026-10-27 09:37:18 -04:00
Sam Lantinga c7b85f6882 testcontroller: fixed gyro noise calibration
Testing:
* Successfully calibrated the DualSense gyro when using GameInput
2026-10-26 18:22:04 -07:00
Sam Lantinga 3dde1dd08d Fixed build when Wayland isn't available 2026-10-26 17:36:21 -07:00
Sam Lantinga ed7764d026 Added GameInput v4 paddle and LED support 2026-10-26 15:09:38 -07:00
Sam Lantinga 526c0e1f80 Removed support for GameInput versions 1-3
This simplifies the logic and we know we're building against GameInput v4. GameInput v0 support is still there for Xbox
2026-10-26 15:09:38 -07:00
Nintorch 5725487eb6 Fix compilation errors with GameInput v4
This PR fixes the compilation errors introduced with updating to GameInput v4.
2026-10-26 15:09:38 -07:00
Anonymous Maarten 9800f58a08 c++98 compat 2026-10-26 15:09:38 -07:00
Anonymous Maarten d252f03f8d Bump GameInput to 4.0.302 2026-10-26 15:09:38 -07:00
sleeptightAnsiC a64f27e76c Fixed invalid property in D3D12 sampler creation
refs: https://github.com/libsdl-org/SDL/commit/dedb92548627be99a51e2e064f645ac5c7ce6515
refs: https://github.com/libsdl-org/SDL/issues/16583#issuecomment-6399925746
2026-10-26 13:47:17 -07:00
Sam Lantinga bd0c0a9ce1 Fixed Android crash if sensors are opened while being quit
The sensor thread no longer blocks when the sensors are locked, so it's safe to keep holding that lock while shutting down.
2026-10-26 11:29:44 -07:00
Sam Lantinga 0b48a5288a Gracefully handle VULKAN_EnsureCommandBuffer() returning false
This can happen on Android when the application is in the background.
2026-10-26 10:10:08 -07:00
Sam Lantinga 8e6f5c42ef Claim and release USB interfaces on the input thread on Android
This fixes an ANR where the UI thread is trying to release a USB interface while long blocking I/O is happening
2026-10-26 09:40:18 -07:00
Sam Lantinga 002c143a82 Fixed java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothGatt.discoverServices()' on a null object reference 2026-10-26 09:18:47 -07:00
Sam Lantinga ba3fbdb884 Not having a property shouldn't trigger an assert with SDL_ASSERT_INVALID_PARAMS 2026-10-26 08:41:45 -07:00
Ryan C. Gordon 660c4acf17 camera/pipewire: Don't block forever in WaitDevice if no signal arrives.
Fixes #10842.
2026-10-25 18:30:53 -04:00
Frank Praznik 52289a276a wayland: Data manager touch ups 2026-10-25 17:26:26 -04:00
Ryan C. Gordon dac33b4369 audio: SDL_AUDIO_FRAMESIZE "returns" an unsigned int.
Otherwise, this macro would always trigger a `-Wsign-conversion` warning,
since it multiplies an unsigned int by a signed int.

Fixes #16539.
2026-10-25 16:04:49 -04:00
Frank Praznik c2560b2940 wayland: Consolidate data manager handling
The data management devices that handle clipboard, drag & drop, and primary selection had functionality split across several source files. Consolidate all handling into the data manager source file, and expose only what is necessary.

Data device handling is untangled from multiple source files, duplicate functionality has been removed, trivial setters/getters have been removed, the internal API has shrunk and been simplified, and many functions have become static.
2026-10-25 15:59:57 -04:00
SDL Wiki Bot aa73ededf6 Sync SDL3 wiki -> header
[ci skip]
2026-10-25 19:19:13 +00:00
Ryan C. Gordon 8be6db493e SDL_keyboard.h: add notes about threading vs SDL_GetKeyboardState.
Fixes #16562.
2026-10-25 15:18:01 -04:00
Sam Lantinga dedb925486 Fixed invalid property in Metal sampler creation 2026-10-25 08:51:26 -07:00
Ozkan Sezer 14f79fa20e update vulkan headers from khronos. 2026-10-25 10:01:10 +03:00
Hernán López e4ed62ee3f X11: preserve clipboard target on failed requests
Keep the requested target in SelectionNotify when the clipboard
callback returns NULL. Mutter otherwise ignores the failure reply,
leaving Wayland clipboard readers waiting.

Fixes libsdl-org/SDL#16567.
2026-10-24 16:04:17 -04:00
Frank Praznik 3da8c67d8d cmake: Remove the hard dependency on the EGL package from Wayland
Wayland has no need for EGL when building SDL without any type of OpenGL support. Only consider it to be a requirement when OpenGL and/or OpenGL ES support is enabled.

This is not to be confused with the wayland-egl package, which is a helper library that is part of libwayland, and, despite the name, doesn't have a dependency on the actual EGL library either.
2026-10-24 12:53:06 -04:00
Antti Ala-Fossi 9c31e40437 Add support for R10G10B10A2_UNORM vertex format 2026-10-24 08:57:21 -07:00
evgeniy.gleba 179de452da stdlib: Fix swapped utf16 and utf32 byte order marks in fallback SDL_iconv() 2026-10-24 08:55:39 -07:00
Alexis Rico b74b85087a cocoa: don't show the menu bar while a fullscreen Space app deactivates
Showing the menu bar from windowDidResignKey while the app was being
deactivated made macOS hand focus back to it, so clicking another app's
window on a different display was undone a moment later. Restore it once
deactivation is done, only when another of our windows took key and is not
itself in a fullscreen Space.
2026-10-24 08:26:39 -07:00
Sam Lantinga 2d14ba15ef Convert "text/plain;charset=utf-8" to NSPasteboardTypeString on macOS (thanks @MoNTE48!)
This fixes text copy and paste on macOS 10.x
2026-10-24 08:15:38 -07:00
Steven Casper 8b6d9694be Use STDAPICALLTYPE instead of __stdcall 2026-10-24 08:02:14 -07:00
Steven Casper bf0433085e Fix GameInputInitialize crash on 32bit
GameInputIntiailize is an STDAPI function, which uses a __stdcall
convention. On 64 bit __stdcall is ignored but on 32 bit the
default calling convention is __cdecl. This results in the stack getting
corrupted and GameInputCreateWithVersion returns to a garbage address.
2026-10-24 08:02:14 -07:00
Sam Lantinga 9496c0cfa1 Fixed crash when using invalid property IDs
Fixes https://github.com/libsdl-org/SDL/issues/16583
2026-10-24 07:47:24 -07:00
Sam Lantinga ee8c1f8af5 Fixed a deadlock when shutting down Android sensors 2026-10-24 09:04:26 -04:00
Sam Lantinga 9b2f87128b Fixed a crash recording float audio on Android 10 2026-10-24 09:04:25 -04:00
Sam Lantinga 554e17488e Fixed DualSense controllers not getting sensors when hotplugged on Android
DualSense controllers come in as a collection of devices which the Android runtime stitches together and when the main controller arrives the sensors aren't available yet. This waits until device changes have settled for 50 ms before notifying SDL that a controller is available.

This also works around a potential deadlock condition in the Android runtime where sensors that are registered while device updates are happening can run into an internal ABBA deadlock.
2026-10-24 09:04:25 -04:00
Sam Lantinga 6e705f6eb4 Fixed setting has_gyroscope on Android 2026-10-24 09:04:25 -04:00
Sam Lantinga d4d1c5e725 Fixed a rare race condition shutting down Android sensors
It's possible for the thread to shutdown after running is set to false and before the looper wake happens. In that case the looper was no longer valid and Android would abort in the wake call.
2026-10-24 09:04:24 -04:00
Sam Lantinga f91c589f54 Fixed exception if unregisterAudioDeviceCallback() is called after the activity context is gone 2026-10-24 09:04:24 -04:00
Sam Lantinga 22a4d8b25e Fixed window orientation on iOS 27
The interface orientation may not be known when windows are created, so wait for it to be known before using it as the window orientation.

Fixes https://github.com/libsdl-org/SDL/issues/16436
2026-10-23 12:02:59 -07:00
Sam Lantinga 6f34ce4d5a Don't re-launch the application for external display scenes on iOS
Fixes https://github.com/libsdl-org/SDL/issues/16161 and part of https://github.com/libsdl-org/SDL/issues/16465
2026-10-23 12:02:59 -07:00
Sam Lantinga 77f5b5bc89 Fixed keyboard focus on iOS
Update window focus as the OS focus changes and make sure we don't accidentally give focus to windows on non-interactive external displays.
2026-10-23 12:02:58 -07:00
Sam Lantinga 9b32375dcc Make sure that UIKit windows go into the right scene for their display 2026-10-23 12:02:58 -07:00
Sam Lantinga 85b4e21bf0 Save and restore the keyboard focus when going into the background on iOS and Android 2026-10-23 12:02:58 -07:00
Sam Lantinga 67f727df51 Fixed whitespace 2026-10-23 12:02:58 -07:00
Frank Praznik 6f98f508bb renderer: Use native framebuffer vsync for the software renderer
SDL_SetWindowSurfaceVSync() will use the native backend framebuffer vsync functionality, if available. Otherwise, the request will be passed though to the window texture renderer, as the surface vsync function pointer is set to SDL_SetWindowTextureVSync() during window texture creation.
2026-10-23 13:54:41 -04:00
Frank Praznik a04d5cfb57 wayland: Add framebuffer vsync support
Factor the frame callback wait code out of the EGL backend, and use it to implement framebuffer vsync as well.
2026-10-23 12:22:09 -04:00
Frank Praznik 8167913fff wayland: Add SHM framebuffer support
This implements SHM framebuffer support for Wayland. It is the most basic way of getting pixels onto the display, and should work even if no GPU driver or libraries are available. It uses no extensions in the interest of simplicity and compatibility.
2026-10-23 12:22:09 -04:00