Commit Graph

20298 Commits

Author SHA1 Message Date
Salman Alshamrani
bd7d4708e3 Fix text field resetting text when replaced with a short string
Triggered by auto-filling a password with less than 16 characters from a
password manager.
2025-08-13 08:05:58 -07:00
ChaseKnowlden
10478c59db Keep MSVC Flags Consistent across CMake runs 2025-08-12 19:39:02 -07:00
Mitch Cairns
62b9ac3a09 SEWN Button Convention 2025-08-12 15:19:01 -07:00
Mitch Cairns
87543ba18c SInput: Mapping updates for GCUltimate/ProGCC
- In previous firmwares for my gamepads, the buttons were sent in a static order for ABXY.
- To better be 'transparent' to the driver and save myself from future fragmentation, I am updating the mappings to be consistent, where the HID report should always expect to receive the button inputs based on cardinal button directions rather than button labels.
- This better aligns with the existing 'fallback' behavior of a generic device.
- Coincides with firmware library update: https://github.com/HandHeldLegend/HOJA-LIB-RP2040/pull/30
2025-08-12 15:19:01 -07:00
SDL Wiki Bot
7487880e4c Sync SDL3 wiki -> header
[ci skip]
2025-08-12 17:05:23 +00:00
Sam Lantinga
4725213eef Support the "ambient" value for SDL_HINT_AUDIO_CATEGORY
Fixes https://github.com/libsdl-org/SDL/issues/13732
2025-08-12 09:54:20 -07:00
SDL Wiki Bot
4b2a87a5d3 Sync SDL3 wiki -> header
[ci skip]
2025-08-12 16:53:08 +00:00
Sylvain
970c0bfe96 Fixed bug #13493: Assertion failure at SDL_AddTouch with Android API 28
Java touch id should be -1 because it's reserved for internal SDL
synthetic events.
It should also not be 0, because this is SDL invalid value.
2025-08-12 18:34:42 +02:00
Chase Knowlden
6e422e5ff2 Update NDK version to 28 (#13729)
* Update NDK version to 28 and add 16kb page size linker flags to x86_64

* Remove Android Linker Options

16kb page size is now the default since NDK r28c

* Update Android CI to use NDK 28
2025-08-12 07:45:57 -07:00
Beyley Cardellio
e699f3dca1 GPU: Hold submit lock before waiting for device idle 2025-08-10 07:21:55 -07:00
SDL Wiki Bot
f2df279adc Sync SDL3 wiki -> header
[ci skip]
2025-08-10 05:08:26 +00:00
Sam Lantinga
40ec9592f1 Restored text missing during wiki sync (thanks @sezero!) 2025-08-09 22:07:14 -07:00
SDL Wiki Bot
3970acd1c2 Sync SDL3 wiki -> header
[ci skip]
2025-08-10 02:21:43 +00:00
SDL Wiki Bot
44ce826b57 Sync SDL3 wiki -> header
[ci skip]
2025-08-09 18:34:27 +00:00
Petar Popovic
43f3991398 linux/SDL_syshaptic.c:SDL_SYS_HapticStopAll(): Fix return on error 2025-08-09 09:27:35 -07:00
Petar Popovic
d4819db5e6 SDL_waylandvideo.c:display_remove_global(): Check pointer when removing mouse 2025-08-09 07:37:40 -07:00
Anonymous Maarten
7017fbaa8e release: build aarch64 libraries with 16kiB page size
[ci skip]
2025-08-09 04:51:35 +02:00
Mohamed Shazan
f4c124e4bf SDL_TriggerBreakpoint() will default to __debugbreak() on MinGW toolchain on windows 2025-08-08 16:20:59 -07:00
Frank Praznik
aff1a48bd9 wayland: Cleanup and return if keymap allocation fails 2025-08-08 18:44:41 -04:00
Petar Popovic
d9c20cfd0a SDL_SendJoystickVirtualSensorDataInner(): Fix max_sensor_events increment 2025-08-08 12:48:06 -07:00
Anonymous Maarten
de742e9f9a cmake: detect RISCOS platform before GNU/Hurd 2025-08-08 12:47:09 -07:00
Pino Toscano
171885010d Add GNU/Hurd as platform
SDL has been building on GNU/Hurd for a long time, using either drivers
based on external libraries (e.g. X11, pulseaudio, sndio, etc) or dummy
drivers. This commit introduces it explicitly as platform, so it can be
recognized, and tweaked as needed. In particular:
- introduce the SDL_PLATFORM_HURD define
- tighten/improve the platform detection in cmake, and use "Hurd" as
  identifier
- return the platform name in SDL_GetPlatform()
- tweak the CFLAGS/LDFLAGS so pthreads can be used properly
- implement SDL_GetExeName(), using /proc/self/exe as provided by the
  basic Linux-like procfs
- enable GLES 2 in tests (mostly for consistency with Linux)
2025-08-08 12:47:09 -07:00
Petar Popovic
b63c32e790 SDL_SetRenderDrawBlendMode(): Remove redundant param check 2025-08-08 14:05:33 -04:00
Frank Praznik
7252633345 video: Check the display origin when a fullscreen window is moved
In certain cases when moving fullscreen windows in scaled desktop configurations, the window origin might overlap two displays at once. Check if the window is at the origin of a specific display before falling back to the generic window rectangle check.

Fixes rare fullscreen window misplacement when moving fullscreen windows via a desktop shortcut while using the Wayland scale-to-display mode.
2025-08-08 11:14:09 -04:00
Pino Toscano
248bcf6b29 ime: fcitx: use SDL_GetExeName() in GetAppName()
Use the existing SDL_GetExeName(), available for all the UNIX
platforms, in the internal GetAppName(); this has few advantanges:
- SDL_GetExeName() (and SDL_GetAppID() that builds on top of it) are
  used in various places already; since it caches the executable name,
  this may remove one extra read of the application name
- SDL_GetExeName() has a non-dummy implementation in more OSes than
  GetAppName(), thus providing a small improvement for this IME

As drive-by change: since SDL_GetExeName() provides a constant string,
there is no more need to allocate a new string in GetAppName(), which
is used as constant string anyway. Hence, return a constant string in
GetAppName() too.
2025-08-07 13:58:09 -07:00
Simon McVittie
d83503f80e Fix some typos detected by Debian's lintian QA tool
I assume the demoninator is a typo, rather than an indication that
someone has been playing too much Doom :-)

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-08-07 13:55:15 -07:00
Simon McVittie
40b941c826 hints: Rephrase documentation to improve grammar
"This thing allows to do something" is not really grammatically correct.
The closest rephrasing would be "allows one to do something" or "allows
the user to do something", but I think the passive voice reads more
naturally here.

Detected by Debian's lintian QA tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-08-07 13:55:15 -07:00
cosmonaut
fe6b2161bf GPU: Fix uninitialized value in Vulkan command buffer structure 2025-08-07 13:42:03 -07:00
Sam Lantinga
6981522cd6 Revert "Support Google Play 16 KB Page Size Requirement (#13470)"
This reverts commit dc2c83c383

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:44:45 -07:00
Frank Praznik
33c8998598 video: Use additional checks for determining on which display a window should be fullscreen
Trying to determine where a window should be made fullscreen from the size and position can be unreliable if the window exceeds the display bounds. Add additional checks with the following priority:

- If the window was positioned with a macro that explicitly passes a display ID, store and use the requested display as the explicit fullscreen target.
- Check if the window position is an exact match for any display origins, and use that display if found, as positioning a fullscreen window by moving it to the origin of the destination display is common behavior.
- Fall back to the existing center point check if the previous checks were not successful, as it is known behavior, and won't risk breaking existing clients that rely on it.
2025-08-07 14:30:39 -04:00
Pino Toscano
561c99ee11 SDL_endian.h: extend Linux way for GNU libc
The currently used way to determine the endianness (i.e. include
<endian.h> and use the __BYTE_ORDER macro) is provided in general by
GNU libc. Thus, extend that to any platform/OS based on GNU libc.
2025-08-06 16:13:26 -07:00
Frank Praznik
f439e44771 x11: Modernize and optimize key handling
- Use modern Xkb functions where appropriate and cleanly separate the modern and legacy paths.
- Remove the deprecated XKeycodeToKeysym function in favor of directly querying the keymap on the legacy path.
- Look up virtual modifiers by name on the Xkb path to better handle remapping (equivalent to the modifier handling under Wayland).
- Optimize keymap creation on the Xkb path to cut keymap build times and enable fast group switching  (equivalent to keymap handling on Wayland).
- Enable and handle Xkb events to handle changes to the group, mapping, and modifier states. This is more reliable than using the legacy events (group changes may not arrive if the window lacks pointer focus), and better handles cases where modifiers are latched, locked, or activated externally rather than physically pressed.
2025-08-06 13:35:32 -07:00
Frank Praznik
67e5130441 x11: Check axis labels when searching for relative axes
Prefer axes with the 'Rel X'/'Rel Y' labels, followed by 'Abs X'/'Abs Y', and only fall back to the old behavior of using the first two enumerated axes if no others are found.

Fixes a FIXME when determining which axes to use for relative motion.
2025-08-06 14:15:00 -04:00
Sam Lantinga
91be1b054a x11: Fix xsettings pointer not being reset in X11_QuitXsettings 2025-08-06 09:22:33 -07:00
Sam Lantinga
31ba7efa48 x11: Refactor dpi hooks, removing GTK dependency and fixing XSettings watcher
- Removed GTK signal handler in x11settings. XSettings events are now properly dispatched to X11_XsettingsNotify.
  Previously events were not being passed to xsettings-client as no SDL xsettings_window was created. Now all events
  are filtered through xsettings_client_process_event allowing it to process the external window events that are selected.
  Global content scale is updated for changes to any recognized dpi settings.

- X11_GetGlobalContent now reads the current RESOURCE_MANAGER prop off of the root window to ensure it sees the
  current value. XResourceManagerString is now only used if getting the current prop fails as it caches the current resource
  manager value per-display connection.

- Clean up some warnings in SDL_gtk.
2025-08-06 09:22:15 -07:00
A1029384756
b139821903 tray: linux - use .cache directory for temporary icon paths 2025-08-05 23:35:11 -07:00
Frank Praznik
cd0c660dea win32: Use the current flags to determine if NCCALCSIZE is required
SDL_GetWindowFlags() also ORs in pending flags, whereas the current state is needed here, particularly when creating/showing a window.
2025-08-05 18:01:16 -04:00
Frank Praznik
90a023007f win32: Use STYLE_BORDERLESS when showing a pending fullscreen window
In addition to hiding the border on bordered windows that will immediately become fullscreen, The combination of flags used in STYLE_BORDERLESS_WINDOWED will still show the borders on borderless windows if the initial window size exactly matches the desktop, so STYLE_BORDERLESS must be used instead.
2025-08-05 15:57:52 -04:00
Sam Lantinga
aae7736ec6 Added additional examples of paddle and misc buttons (thanks @AL2009man!) 2025-08-05 12:01:31 -07:00
Frank Praznik
f44a98729c cocoa: Wait for fullscreen spaces transitions to complete if switching to an exclusive mode
If attempting to switch to an exclusive mode while a fullscreen spaces transition is active, wait until the transition is complete before trying to apply the changes, or the window can wind up in a weird, broken state if a mode switch occurs while in a fullscreen space.
2025-08-05 11:38:54 -04:00
Frank Praznik
3163e0cc9f Revert "cocoa: Don't re-enter a fullscreen space if leaving to enter an exclusive mode"
This reverts commit ee8f2861e7.

It turns out that the problem is elsewhere, related to needing to block mode changes until spaces transitions are complete.
2025-08-04 23:49:15 -04:00
Alexander Batalov
b6fa89ea74 Fix directory globbing on Android 2025-08-04 23:12:54 -04:00
Mathieu Eyraud
a05aca51ec Fix condition for setting HDR properties 2025-08-04 23:02:25 -04:00
Frank Praznik
ee8f2861e7 cocoa: Don't re-enter a fullscreen space if leaving to enter an exclusive mode
Doing so can leave the window in a weird, offset state.
2025-08-04 22:09:53 -04:00
Sam Lantinga
293b8b9fd6 x11: Fix regression reading GNOME content scale
- Removed gtk-xft-dpi read from GetGlobalContentScale. Xrm either returns either the same value as gtk-xft-dpi or the integer
  scale value in cases where gtk-xft-dpi is 1.

- Refactor SDL_x11settings handlers to defer to GetGlobalContentScale

- GetGlobalContentScale is now exported and the XSettings and Gtk signal handlers now use it for consistency. This involves
  a bit of extra work reading from Xrm rather than the setting notification but ensures consistent handling based on signal
  origin and hints enabled.

- Hook both gtk-xft-dpi in SDL_x11settings. This should generally result in only one being called based on which is updated.
  Since both signal handlers defer to X11_GetGlobalContentScale this will cause the same content scale to be applied multiple
  times. The gtk-xft-dpi signal is now only used to trigger content scale updates when the XSettings notification does not occur.
2025-08-04 16:53:09 -07:00
Sam Lantinga
7bb045ca22 Fixed Windows build 2025-08-04 13:04:17 -07:00
Sam Lantinga
9a71e3fd50 Revert "Add SDL_IsTraySupported"
This reverts commit 47d8bdd1c3.

There are runtime reasons why creating a tray can fail, so the correct approach is not to assume that just because a platform supports a tray that trays are available. Instead, you should create a tray at application startup, for the lifetime of the application, and handle failures at that point.

Closes https://github.com/libsdl-org/SDL/pull/13632
2025-08-04 10:42:43 -07:00
Sam Lantinga
bba6555bf1 Enable background input when using Microsoft GameInput 2025-08-04 10:21:58 -07:00
Frank Praznik
483b8d4d98 x11: Implement precision/pixel scrolling
Manual rebase of #5382 with some changes for SDL3 (thanks @wooosh).
2025-08-04 12:50:06 -04:00
Petar Popovic
23e08f7807 SDL_LoadWAV_IO(): On error, set *audio_buf to NULL and *audio_len to 0 2025-08-03 13:44:10 -04:00