Commit Graph

21777 Commits

Author SHA1 Message Date
Frank Praznik
7626a9c313 x11: Don't block when withdrawing unmapped windows
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.

(cherry picked from commit e442a9a5e1)
2026-07-15 12:05:33 -04:00
Frank Praznik
d8b18a7e18 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.

(cherry picked from commit 1a9801a16f)
2026-07-15 11:32:24 -04:00
Sam Lantinga
558f62eb07 Don't accidentally switch the Horipad Mini into Switch report mode
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.

(cherry picked from commit 2d7f300783)
2026-07-14 15:37:05 -07:00
Sam Clegg
4ad0d1f7eb [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

(cherry picked from commit 31bd4ff77a)
2026-07-14 12:31:37 -07:00
Frank Praznik
432719facc 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.

(cherry picked from commit 8586f63d2a)
2026-07-14 13:37:09 -04:00
Ryan C. Gordon
5b5713b955 properties: Fixed a typo in a comment. 2026-07-13 18:38:30 -04:00
Ryan C. Gordon
ecd15e9535 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.

(cherry picked from commit daf519ae05)
2026-07-13 18:23:46 -04:00
Tim Stahlhut
758e323b93 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]

(cherry picked from commit c97d9feb13)
2026-07-13 09:07:58 -07:00
Nintorch
5311486a9a Emscripten: Convert joystick axis 9 to a hat
(cherry picked from commit d11e3e087a)
2026-07-11 08:01:54 -07:00
Sam Lantinga
6ebd9cf86b testffmpeg_vulkan: enable the VK_KHR_video_maintenance1 extension
This is used by ffmpeg, so we'll enable it if it's available

(cherry picked from commit 9149eca207)
2026-07-10 11:41:14 -07:00
Sam Lantinga
1453f46178 testffmpeg_vulkan: fixed goto jump past variable initialization
(cherry picked from commit 094213b3be)
2026-07-10 10:09:06 -07:00
Sam Lantinga
da8614ff0f testffmpeg: added a --nodelay command line option
(cherry picked from commit 4a00b98c91)
2026-07-10 10:09:06 -07:00
Sam Lantinga
99ca7097d2 testffmpeg_vulkan: use C++ compatible code structure
(cherry picked from commit 573fc51938)
2026-07-10 10:09:06 -07:00
Sam Lantinga
480ab44f9e testffmpeg_vulkan: fixed usage of timeline semaphores
(cherry picked from commit 6ce3d843fc)
2026-07-10 10:09:06 -07:00
Sam Lantinga
5671b0f3ce Fixed Vulkan validation errors when using ffmpeg video decode
(cherry picked from commit c1d4376d3c)
2026-07-10 08:21:02 -07:00
Sam Lantinga
dcb3da5489 Revert "Cygwin: Reduce warning"
This reverts commit 3eb9b5e49a.
2026-07-09 09:14:38 -07:00
Tim Stahlhut
3eb9b5e49a Cygwin: Reduce warning
[sdl-ci-filter cygwin]
[sdl-ci-filter msys2-*]
[sdl-ci-filter msvc-*]

(cherry picked from commit bb74b618ac)
2026-07-09 09:04:00 -07:00
Epifanov Ivan
e5648d4437 VITA: invalidate texture in render state on update (#15957)
(cherry picked from commit 425c6a2695)
2026-07-08 07:11:33 -07:00
meta-legend
af5b015b21 Avoid unnescessarily updating fullscreen display modes
(cherry picked from commit e90bdfb5ea)
2026-07-07 21:37:53 -07:00
ExtremelyLazyCat
4f629701fb Add Mayflash N64 Controller Adapter mapping
(cherry picked from commit 5403934fd3)
2026-07-07 14:05:17 -07:00
Sam Lantinga
ffc7381337 Only skip the Flydigi driver when checking to see if a device is handled by HIDAPI
(cherry picked from commit cf6a235a41)
2026-07-07 09:30:49 -07:00
Isabella Basso
27e6b7a119 cocoa: restore discrete mouse wheel ticks
(cherry picked from commit 1f3f714393)
2026-07-07 11:08:20 -04:00
Sam Lantinga
b18591f4a0 Fixed the 8BitDo Pro 3 controller showing up twice on macOS
Fixes https://github.com/libsdl-org/SDL/issues/15890

(cherry picked from commit 03f81ab4aa)
2026-07-06 17:04:42 -07:00
8BitDo
1ac361c3fe support 8bitdo ultimate 3 (#15927)
(cherry picked from commit efa0e2d5ed)
2026-07-06 05:51:06 -07:00
Caleb Cornett
6c10cdb6eb gpu: Metal fence fixes
(cherry picked from commit 3561f81400)
2026-07-06 05:44:50 -07:00
Alex Tselousov
7e593a2b4f Removed busyloop from SDL_GPUFence on MacOS
Before, MetalFence was implemented as simply a busy loop on an atomic
int on metal, meaning the cpu would busy wait on the gpu to finish
taking power from it and decreasing battery life. This was the only kind
of cpu-gpu syncing (apart from requesting a swapchain)

(cherry picked from commit 514b26e4c4)
2026-07-06 05:44:50 -07:00
Jacul
a19040c84d metal: check MTLBuffer allocations for nil before using their contents.
(cherry picked from commit e1b3c8afd5)
2026-07-06 05:44:20 -07:00
Ozkan Sezer
c42843c389 ci: bump freebsd and cross-platform-actions 2026-07-05 23:36:32 +03:00
Dimitriy Ryazantcev
1cb193a414 Win32: Swap maskColor assignment based on alpha value
Looks like mask pixels was inverted.

(cherry picked from commit 362165ed9b)
2026-07-05 12:37:46 -07:00
Tim Stahlhut
64f058d050 Use SDL_PROCESS_WINDOWS instead of SDL_PLATFORM_WINDOWS
in SDL_process.c

[sdl-ci-filter cygwin]
[sdl-ci-filter msys2-*]
[sdl-ci-filter msvc-*]

(cherry picked from commit 655c8166a1)
2026-07-04 11:19:44 -07:00
Can H. Tartanoglu
c715180e01 testprocess: handle async exec failure for missing executables
(cherry picked from commit bb6f24e542)
2026-07-04 11:17:33 -07:00
Max Seidenstücker
3348fc6466 SDL_camera.h: remove comma at end of enum
GCC: comma at end of enumerator list [-Wpedantic]

(cherry picked from commit bf58ff81d8)
2026-07-04 04:37:32 +03:00
Zana Domán
81c39b0cc5 gpu: validate transfer buffer usage (#15923)
(cherry picked from commit 095e899973)
2026-07-03 17:11:54 -07:00
Sam Lantinga
932f36590f Updated to version 3.4.13 for development 2026-07-01 09:55:50 -07:00
Sam Lantinga
f87239e71e Updated to version 3.4.12 for release release-3.4.12 2026-07-01 09:20:42 -07:00
Ryan C. Gordon
39aff4c978 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.)

(cherry picked from commit 774728b6ff)
2026-06-30 23:29:41 -04:00
Sam Lantinga
2d8ddf333a Get the physical device properties when using an external Vulkan device
Fixes `testffmpeg --sprites 100` when using the Vulkan renderer

(cherry picked from commit dfefce62e2)
2026-06-30 13:00:30 -07:00
Sam Lantinga
f321b80e7a 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

(cherry picked from commit 464b90b475)
2026-06-30 09:01:05 -07:00
Frank Praznik
6f0544dcca wayland: Fix incorrect dereference when sorting icon surfaces
(cherry picked from commit 2f1cf4629c)
2026-06-30 10:16:28 -04:00
Mason Remaley
25e2ec0407 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.

(cherry picked from commit a168e96cbc)
2026-06-30 09:54:32 -04:00
Sam Lantinga
13a2ea7187 Added a workaround for a crash in NVIDIA drivers when rendering YUV with Vulkan
Fixes https://github.com/libsdl-org/SDL/issues/13878

(cherry picked from commit e0b12bbcea)
2026-06-29 14:18:18 -07:00
Frank Praznik
2ccd76818e 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.

(cherry picked from commit 0a8ccb11eb)
2026-06-29 12:39:36 -04:00
Sam Lantinga
1326f406a6 Removed unnecessary assert in WIN_SetWindowOpacity()
Fixes https://github.com/libsdl-org/SDL/issues/15896

(cherry picked from commit f0e99e7c7f)
2026-06-27 21:10:47 -07:00
BZL
03d17f40bf 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.

(cherry picked from commit 111bb79bf8)
2026-06-27 20:12:20 -07:00
Cameron Gutman
ca7db3216d keyboard: Limit text input event size for sdl2-compat
(cherry picked from commit 32f460d357)
2026-06-27 17:34:52 -07:00
Frank Praznik
ce68c297f0 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.

(cherry picked from commit 607eb5206e)
2026-06-25 09:47:36 -04:00
Ryan C. Gordon
db6d9d5c01 docs: warn not to destroy an SDL_AudioStream during its callback.
Fixes #15871.

(cherry picked from commit 0b692f64b0)
2026-06-23 13:50:57 -04:00
Ryan C. Gordon
929f060b68 examples/input/03-gamepad-polling: Render axes in blue.
It's easier to see against white than yellow was.

(cherry picked from commit d7e25c92c0)
2026-06-19 14:36:14 -04:00
Ryan C. Gordon
76db4ee3e7 wikiheaders: Fix links in manpage generation.
Fixes #15665.

(cherry picked from commit 7134ed5c1c)
2026-06-18 13:46:36 -04:00
Frank Praznik
1de0c4e0f0 wayland: Attach EGL objects to custom and external surfaces during reconfiguration
They are required when using EGL with an external surface.

(cherry picked from commit 06795b00ad)
2026-06-18 10:58:24 -04:00