Commit Graph
22355 Commits
Author SHA1 Message Date
Sam Lantinga 148241117b Define SCRGB_NITS for use in HDR color calculations 2026-07-23 10:25:25 -07:00
AlynneandGitHub b9d64c45a9 Support for Retro Fighters Defender Pro (#16045) 2026-07-23 10:16:51 -07:00
Sam Lantinga 9f4a1215e2 testcolorspace: show a reasonable HDR gradient on Wayland
On some Wayland configurations, the SDR white level is 203 nits and the max luminance is 10000 nits, and HDR content in the PQ range is mapped by the compositor into the actual display capabilities. We don't want to show an HDR gradient up to 10000 nits, so let's cap it to ~1000 nits in this case.
2026-07-23 08:01:05 -07:00
Sam Lantinga 2a623fd224 wayland: set the SDR_white_level for HDR capable displays
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-22 15:24:48 -07:00
Sam Lantinga 0d21a1aa7a testcolorspace: add optional cycling of colorspaces
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-22 11:36:32 -07:00
Sam Lantinga e10457d52f testcolorspace: added an HDR10 gradient 2026-07-22 11:36:32 -07:00
Sam Lantinga 23b641070c Added HDR10 display support for the direct3d11, direct3d12, and vulkan renderers 2026-07-22 11:36:32 -07:00
Frank Praznik cc2713c047 wayland: Don't clear the clipboard when a nil selection is ignored
If the previous selection offering was recursive, a nil selection should be ignored, or clearing the clipboard may clear the backing memory of the client's selection offering as well.
2026-07-22 12:09:18 -04:00
Sam Lantinga ae2301e7a5 Added SDR white point for X11 on Steam Deck
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
Also disabled HDR on X11 for other devices for now, we don't know that they'll be able to display it properly.
2026-07-21 20:24:26 -07:00
Sam Lantinga 75e280618e edid-parse: print the HDR luminance information 2026-07-21 20:24:26 -07:00
Frank Praznik d63137082a test: Fix memory leak in testclipboard
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-21 14:38:48 -04:00
Sam Lantinga c70f111295 Corrected the name of the Razer Raiju V3 Pro controller
Fixes https://github.com/libsdl-org/SDL/issues/16028
2026-07-21 07:47:28 -07:00
Esme PovirkandSam Lantinga 3fc8509b36 Fix build on arm64ec. 2026-07-21 07:44:17 -07:00
Frank Praznik ee1c942a92 mouse: Handle explicit warp events
The warp event in Wayland can occur without explicitly warping the mouse, such as if a window changes position under the cursor while the cursor is stationary. Introduce the internal SDL_SendMouseWarp() function to handle updating the absolute cursor position without generating relative motion for these cases.
2026-07-21 09:59:14 -04:00
Frank Praznik 73010447c3 wayland: Add support for the pointer warp event 2026-07-21 09:59:14 -04:00
Sam Lantinga d98661ff7f Decode the monitor EDID to get HDR metadata on X11
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-20 12:25:17 -07:00
NintorchandSam Lantinga f675aeddeb Use HIDAPI to provide better names for GameInput controllers 2026-07-20 12:18:57 -07:00
Hadrian TangandRyan C. Gordon a8591d943b Fix #15985
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-19 20:06:04 -07:00
Ryan C. Gordon 5ff9c119fc audio: Fixed linked list when logical devs move to a new default physical dev. 2026-07-19 21:49:31 -04:00
SDL Wiki Bot 377150b59e Sync SDL3 wiki -> header
[ci skip]
2026-07-19 16:47:13 +00:00
Hadrian TangandGitHub 8319d69f72 Clear SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER when ANativeWindow is freed (#16024)
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-18 14:59:22 -07:00
Frank Praznik f52f31ef5a notification: Fix Win32 delegate structs
Cast from the generic implementation, which has space for the refcount.
2026-07-18 17:46:02 -04:00
Frank Praznik a0bffd4a92 notification: Use interface availability to check for Windows version suitability
Explicit version checks require application manifests on Win10, or an older version will be reported. Check for the toast notification history interface, which is only available on Win10+, and use that to determine if the Windows version is high enough to support notifications.
2026-07-18 17:46:02 -04:00
Sam Lantinga 08b9c55393 Fixed error: cast from pointer to integer of different size
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-17 22:08:39 -07:00
Sam Lantinga f00052ffe2 testffmpeg: fixed memory leak using DRM frames with the Vulkan renderer
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
2026-07-17 19:24:46 -07:00
Anonymous MaartenandAnonymous Maarten 5133849627 IsEqualGUID uses memcmp behind the scenes, thwarting a NOLIBC build 2026-07-18 02:40:33 +02:00
Sam Lantinga 762f4abbd0 Fixed an error with goto crossing variable initialization 2026-07-17 16:56:23 -07:00
Sam Lantinga 332e7a050e testffmpeg: added support for VA-API and DRM frames when using Vulkan rendering 2026-07-17 16:23:48 -07:00
meta-legendandGitHub ac9ef17bcc Avoid RLE for software render alpha subrect copies (#15982) 2026-07-17 15:09:42 -07:00
Ryan C. Gordon df7b937361 android: Fix pen creating phantom mouse events in relative mode.
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
This mostly just unifies code that was handling this case elsewhere already.

Fixes #15620.
2026-07-17 12:59:26 -04:00
Vlad ZahorodniiandFrank Praznik 6eba2f2efe wayland: Add support for wl_fixes.ack_global_remove
Build (All) / Create test plan (push) Canceled after 0s
Build (All) / level1 (push) Canceled after 0s
Build (All) / level2 (push) Canceled after 0s
The wl_fixes.ack_global_remove request signals the compositor that the
client will not bind the removed global. It can be used by the
compositor to decide when it is safe to actually destroy the
corresponding global. If a global is destroyed too soon, some clients may
get disconnected.

See also https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/533
2026-07-16 12:30:58 -04:00
Antonio OspiteandSam Lantinga d330686798 test: Remove superfluous null byte from ps3_hid_report_descriptor
Remove a superfluous null byte at the end of ps3_hid_report_descriptor,
as it might confuse some more stricter parser.

The data in ps3_hid_report_descriptor probably comes for a libinput
recording, and sometimes those can have superfluous null byte at the
end.

This is mentioned for example in the hidreport project:
https://github.com/hidutils/hidreport/blob/64d40674038e8bb5e76c4191f5561ec1928c3c72/tools/libinput-recording-extract-hid-descriptor.py#L25-L27

As a proof that the original HID report descriptor of the actual device
is 148 bytes long, the following lsusb capture can be compared:
http://ps3.jim.sh/sixaxis/usb/lsusb.txt

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
2026-07-16 08:53:14 -07:00
Anonymous MaartenandAnonymous Maarten 64067c11ac ci: treat CMake deprecated and development warnings as errors
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
[sdl-ci-filter *]
2026-07-16 03:50:19 +02:00
Frank Praznik e442a9a5e1 x11: Don't block when withdrawing unmapped windows
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Some window managers will mark minimized or offscreen windows as unmapped. When hiding a window, unconditionally call XWithdrawWindow, and don't wait for an UnmapNotify event if the window is already in the unmapped state, or it will block indefinitely waiting for an event that never arrives.
2026-07-15 12:05:00 -04:00
klirktagandSam Lantinga 8408a664e2 Android: restore the system bars when leaving fullscreen on API 30+
My old PR #15867 switched the fullscreen path to WindowInsetsController.hide() for API 30+, because the legacy setSystemUiVisibility() flags are ignored on API 30+.

The leaving fullscreen path was left untouched: it still calls setSystemUiVisibility(SYSTEM_UI_FLAG_VISIBLE), which is equally ignored on API 30+.

As a result, once fullscreen had hidden the status/navigation bars, they never came back when returning to windowed mode.
2026-07-15 08:15:18 -07:00
rewineandFrank Praznik edafd519b9 wayland: bind xdg-decoration-manager-v1 at protocol version 2
v2 removes v1's strict ordering requirement (decoration object must be created and configured before any buffer is attached), allowing xdg_toplevel_decoration to be created even after a buffer has already been attached/committed
2026-07-15 10:35:17 -04:00
Frank Praznik 1a9801a16f cocoa: Clear state on failure to enter fullscreen
A fullscreen exit event doesn't always accompany an entry error, so ensure that all relevant state is cleared if the window fails to enter fullscreen.
2026-07-15 10:32:51 -04:00
Sam Lantinga 2d7f300783 Don't accidentally switch the Horipad Mini into Switch report mode
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
The PS3 probing switches the HORI Horipad Mini into Nintendo Switch report mode, which we don't recognize since it's still using the Xbox 360 endpoint.
2026-07-14 15:24:49 -07:00
Sam CleggandSam Lantinga 31bd4ff77a [emscripten] Remove support for legacy webkitGetUserMedia
This modern navigator.mediaDevices.getUserMedia has been
available since Chrome 53 / Firefox 38 / Safari 11.

See https://github.com/emscripten-core/emscripten/pull/27347
2026-07-14 12:31:15 -07:00
Frank Praznik 8586f63d2a wayland: Refine window raising for new windows
Generate activation tokens for new windows when necessary, and check the hint for activating windows when shown. This will allow new windows to correctly take focus in environments with elevated focus stealing prevention when possible, and it will try to prevent new windows from being activated if the hint is set to false.
2026-07-14 13:33:57 -04:00
Hans-Kristian ArntzenandSam Lantinga 52ec5120a0 [Video/KMSDRM]: Prefer largest compatible refresh rate by default. 2026-07-14 10:25:28 -07:00
Ryan C. Gordon 758dab45af properties: Fixed a typo in a comment.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
(cherry picked from commit 5b5713b955)
2026-07-13 18:39:23 -04:00
Ryan C. GordonandSam Lantinga c9ebec4687 iostream: Create properties on-demand instead of upfront.
It's possible that IOStreams might get created and thrown away a lot, perhaps
at any point in an app's lifetime, so it makes sense to avoid doing the work
of maintaining a properties group for each, if the app hasn't requested it,
since this requires a bunch of allocations and locks.

It's not necessarily worth doing this for other SDL objects, like SDL_Window,
since there are likely to only be a few of them, and likely created at startup
and living for the entire lifespan of the app.

Fixes #14436.
2026-07-13 15:33:08 -07:00
Ryan C. Gordon daf519ae05 assert: make disabled asserts work with bitfield conditions.
We don't care _what_ the `sizeof` results are, we just want it to vaporize
the condition's code out of the build. So we check it with a `? 1 : 0`, so it
always boils down to a `sizeof (int)`, no matter what data type the condition
actually is.

This works with bitfields, pointers, anything that can be "truthy." If it
isn't truthy, it would fail when assertions are enabled anyhow.

Fixes #15990.
2026-07-13 18:17:33 -04:00
Ozkan SezerandÖzkan Sezer a6c294410e introduce new printf format macros SDL_PRISZu, SDL_PRISZx and SDL_PRISZX 2026-07-13 22:35:03 +03:00
Sam Lantinga 1f188100bc Added an msys build to the priority build list 2026-07-13 09:24:04 -07:00
Sam Lantinga 80be09a804 Fixed error: unknown conversion type character 'z' in format
That apparently isn't supported by the mingw compiler
2026-07-13 09:22:14 -07:00
Tim StahlhutandSam Lantinga c97d9feb13 Rewrite five SDL_DIRECTX header checks
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

[sdl-ci-filter msvc-*]
[sdl-ci-filter msys2-*]
[sdl-ci-filter cygwin]
[sdl-ci-filter ngage]
2026-07-13 09:07:26 -07:00
Antonio OspiteandGitHub b9758218c8 Misc cleanup for src/joystick/hidapi/SDL_report_descriptor.c and new test program (#15959)
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
* testevdev: Always use decimal for HID report descriptors size

The size of the HID report descriptors in the SDL_COMPILE_TIME_ASSERT
checks is specified sometimes in decimal and sometimes in octal.

Always used decimal for consistency.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* SDL_report_descriptor: Add missing include guards in header file

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* SDL_report_descriptor: Fix some ignored return values

Fix some ignored return values resulting in incomplete error checking.

For instance:

  - ParseMainItem() was always returning true because the return value of
    AddInputFields() was not handled.

  - ParseLocalItem() was always returning true because the return value of
    AddUsage() was not handled.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* test: Add new test program for SDL_report_descriptor code

Add support for testing the SDL_report_descriptor code by adding a new
executable to make it easier to experiment with HID report descriptor
parsing.

The main() function which originally was in
src/joystick/hidapi/SDL_report_descriptor.c is moved to a separate file
named test/testdescriptor.c in order to simplify dealing with multiple
build systems.

For instance if the main() was in
src/joystick/hidapi/SDL_report_descriptor.c the code would have to
account for the cases when the file is built as part of the library or
when it's built as part of a standalone executable, in which case the
dynamic API mechanism needs to be disabled.

This would pose a problem especially with MSVC which uses pre-compiled
headers (PCH) which do not sit well with the preprocessor logic that
would be needed, like the hacks added in test/testevdev.c

Using a completely separate source file for the standalone executable
avoids the issue, especially considering that the new file is not built
with MSVC at all.

The new test program can be built with:

  cmake -DCMAKE_BUILD_TYPE=Debug -DSDL_TESTS=ON -S . -B build
  make -C testdescriptor

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* testdescriptor: Fix compiler warning

Fix compiler warning:

-----------------------------------------------------------------------
.../test/testdescriptor.c: In function ‘main’:
.../test/testdescriptor.c:56:17: warning: unused variable ‘file’ [-Wunused-variable]
   56 |     const char *file = argv[1];
      |                 ^~~~

-----------------------------------------------------------------------

Use the `file` variable when appropriate since it is already declared
and assigned.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* testdescriptor: Clean up descriptor context before exiting

For correctness clean up the descriptor parsing context before exiting,
even though this is not a problem in practice for a standalone
executable.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* testdescriptor: Exercise public API for parsing report descriptor

This gives some more coverage when running the SDL_report_descriptor
test program.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* SDL_report_descriptor: use size_t for variables that represent buffer sizes

Using size_t type for variables that represent buffer sizes in
src/joystick/hidapi/SDL_report_descriptor.[hc] addresses possible errors
when using the functions in combination with SDL_LoadFile, like in
test/testdescriptor.c

When building with CMake on Windows x64 the compilation was failing with
the following error:

-----------------------------------------------------------------------
D:\a\SDL\SDL\test\testdescriptor.c(69): error C2220: the following warning is treated as an error
D:\a\SDL\SDL\test\testdescriptor.c(69): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data
-----------------------------------------------------------------------

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

* SDL_hidapi_xboxone: protect against passing negative size to SDL_ReadReportData

Since SDL_ReadReportData() is now using size_t for the buffer size, also
change its user HIDAPI_DriverXboxOne_HandleDescriptorReport to pass
size_t, but protecting against possible cases of passing negative values
to SDL_ReadReportData().

To do that it is enough to check that the "size" argument is not zero,
so it will never be negative when decremented (size--) a few lines
below.

Note: this just addresses a theoretical issue with future callers of
HIDAPI_DriverXboxOne_HandleDescriptorReport, the current code would be
already safe as the current caller already checks that size > 0.

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>

---------

Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
2026-07-13 08:26:03 -07:00
Ryan C. GordonandSam Lantinga d629eb3bf0 vita: Treat the d-pad as a hat switch at the SDL_Joystick level.
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Reference Issue #14830.

[sdl-ci-filter *]
2026-07-11 20:33:10 -07:00