Commit Graph

819 Commits

Author SHA1 Message Date
Sam Lantinga
dafca86123 Cleanup SDL_UDEV_GetProductSerial() 2025-11-12 22:23:27 -08:00
pmx
54f129f765 FIX SDL_GetJoystickSerial() always returning NULL on Linux (UDEV) (#14454) 2025-11-12 14:25:31 -08:00
Ethan Lee
702a1adf4a windows: Add WIN_IsWindows11OrGreater, using a dwBuildNumber helper function 2025-11-12 16:22:35 -05:00
Sam Lantinga
0c5f7f6a33 unix: Unref SDL_gtk context on quit 2025-11-12 11:42:02 -08:00
Frank Praznik
f3d39815e7 progressbar: Ensure buffers are large enough for string manipulation 2025-11-09 16:59:35 -05:00
Joshua T. Fisher
641deb9c0e Initial port to SDL3 audio subsystem 2025-11-03 10:08:50 -05:00
Quentin Thébault
3b80fcd1a0 KMSDRM/EVDEV: add VT switching support for FreeBSD (#14346)
Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr>
2025-10-29 09:52:32 -07:00
Eddy Jansson
f773da2273 log: Rework NGAGE logging. (#14321)
This moves the NGAGE file logging into SDL_LogOutput(), following the pattern of the 3DS, VITA, PSP, etc.
2025-10-27 08:48:04 -07:00
Sam Lantinga
be781fc8f5 Updated to version 3.3.3 for development 2025-10-23 22:41:03 -07:00
Sam Lantinga
b31c4b70b3 Updated version and documentation for 3.3.2 preview release 2025-10-23 15:20:26 -07:00
Eddy Jansson
aaee09d6ed Don't do NULL-checks before SDL_free()
Replaces the pattern

  if (ptr) {
    SDL_free(ptr);
  }

with

  SDL_free(ptr);
2025-10-20 00:13:09 -07:00
Frank Praznik
427f838f58 unix: Add ppoll support
Allows for finer grained timeout values, and fixes a FIXME.

This also drops the legacy select() fallback path in favor of presuming that poll() is always available. poll() is part of the POSIX.1-2001 standard, has been available in Unix since some time in the 1980s, the BSDs since at least the early 90s, and Linux since kernel 2.1, which predates kernel support for Pthreads. glibc also has its own emulation using select(), if necessary.
2025-10-17 14:30:10 -04:00
Susko3
e2bbbdc515 Implement SDL_GetPenDeviceType() for Android 2025-10-13 18:43:16 -04:00
Sam Lantinga
6b5b0ca90a Fixed header include guards 2025-10-13 09:46:15 -07:00
Brenton Bostick
e584d2a8a9 fill-in missing DeleteLocalRef calls 2025-10-13 09:28:29 -07:00
Sylvain Becker
71bf56c9e4 Add SDL Pinch events (#9445) 2025-10-12 14:44:23 -07:00
Ozkan Sezer
2603565993 SDL_gtk.c: make private procedure signal_connect() static 2025-10-11 02:51:14 +03:00
Ozkan Sezer
ae7643e8ae SDL_fribidi.h: include sys/types.h for ssize_t.
also remove fribidi.h include from SDL_fribidi.c (already included
by SDL_fribidi.h) and do style clean-up.
2025-10-11 02:50:20 +03:00
Sam Lantinga
1871b998cd Added SDL_EVENT_SCREEN_KEYBOARD_SHOWN and SDL_EVENT_SCREEN_KEYBOARD_HIDDEN
Fixes https://github.com/libsdl-org/SDL/issues/13049
2025-10-10 10:14:07 -07:00
Sam Lantinga
b5c9a83f65 Display error messages when evdev devices can't be opened
Fixes https://github.com/libsdl-org/SDL/issues/13141
2025-10-09 13:18:56 -07:00
Anonymous Maarten
e1fde46a6a Include SDL_internal.h before checking HAVE_FRIBIDI_H
This happened to work because of precompiled headers
2025-10-04 21:25:45 +02:00
Anonymous Maarten
f69981cbfb Use space indendation in SDL_fribidi sources 2025-10-04 21:25:45 +02:00
Simon McVittie
1c1f7082ab Only emit dlopen note for SDL_FRIBIDI_DYNAMIC if not a hard dependency
Fixes: 65b36721 "unix: Mark SDL_FRIBIDI_DYNAMIC as a weak dependency"
Thanks: Anonymous Maarten
2025-10-04 17:21:49 +03:00
Simon McVittie
65b367216e unix: Mark SDL_FRIBIDI_DYNAMIC as a weak dependency
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-10-04 14:15:19 +03:00
Simon McVittie
2a96bddebf unix: Clean up trailing whitespace in SDL_fribidi.c
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-10-04 14:10:00 +03:00
eafton
c2429e85ec X11TK: Add Arabic/Hebrew/Farsi support by increasing font size slightly and using FriBidi. (#14134) 2025-10-03 19:08:24 -07:00
Anonymous Maarten
cdc4609993 Add headers for unsupported sources 2025-09-26 21:42:04 +02:00
Simon McVittie
c13e74be6b progress: Correct calls to dbus_message_iter_open_container with variants
As documented, the contained_signature is to be passed in as a
nul-terminated C string.

For basic types that are represented by a single character, on
little-endian platforms, putting the type in the least significant
byte of an int and casting its address to `char *` happens to result in
a valid string, because the int's in-memory representation looks like
`(char []){ 'b', 0, 0, 0 }`. However, on big-endian platforms, the int's
in-memory representation is `(char []){ 0, 0, 0, 'b' }` which is not
a valid type for a D-Bus variant to hold (it is interpreted as an empty
string, and variants are not allowed to be empty).

Instead, do this the straightforward way, with a mnemonic string and
no casts (in the same style used in `SDL_portaldialog`).

Fixes: 3f2226a9 "Add progress bar support for Linux"
Resolves: https://github.com/libsdl-org/SDL/issues/13953
Bug-Debian: https://bugs.debian.org/1115705
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-09-23 08:19:25 -07:00
Brenton Bostick
8abbb98222 Android: fix 'JVM object referenced by 'context' is of type 'Context' and it d… (#14016)
fix 'JVM object referenced by 'context' is of type 'Context' and it does not have access to method 'registerReceiver(BroadcastReceiver, IntentFilter)' declared in class 'ContextWrapper'.'
2025-09-22 08:15:48 -07:00
Brenton Bostick
8d86ee4995 fix various places where nativeSetupJNI being treated as returning int 2025-09-22 07:25:57 -07:00
Brenton Bostick
6590a5bc0b fix: Extra parameter(s) for call to 'getCacheDir()'. 2025-09-22 07:25:00 -07:00
Brenton Bostick
ed7d39b28c fix 'SDL_MessageBoxFlags' is not a valid JVM type. 2025-09-22 07:03:49 -07:00
Sam Lantinga
6a9ac1cacd Always poll udev on supported platforms
Fixes https://github.com/libsdl-org/SDL/issues/13995
2025-09-20 11:13:39 -07:00
Sam Lantinga
25b2d2c821 Use new parameter validation macro 2025-09-18 20:58:32 -07:00
Sam Lantinga
3ddc3f1146 Send events for mice and keyboards detected during initialization
Fixes https://github.com/libsdl-org/SDL/issues/12815
2025-09-11 20:07:55 -07:00
nightmareci
2f5bc17ea6 Fix support for Windows XP and up (#13904) 2025-09-08 13:00:26 -07:00
Ryan C. Gordon
b8197a2291 io: rework how we set SDL_IOStream status.
This now relies on the implementation to set these flags on short reads/writes
instead of the higher level checking if SDL_SetError() was called.

Additionally (and crucially), this now sets ERROR or EOF on all short reads,
across all backends, not just when we get a zero-byte return value.

Fixes #13720.
2025-09-05 12:43:13 -04:00
Anonymous Maarten
0a6b80717c Record dynamic dependencies in .note.dlopen elf section 2025-08-27 16:11:39 +00:00
Sam Lantinga
da6e9bbf7c Allow building the tray subsystem without the video subsystem
Fixes https://github.com/libsdl-org/SDL/issues/13235
2025-08-27 08:15:24 -07: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
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
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
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
Alexander Batalov
b6fa89ea74 Fix directory globbing on Android 2025-08-04 23:12:54 -04:00
Hayden Gray
cb5436045d tray: linux fix tray menu elements not running callbacks (#13626) 2025-08-03 07:22:32 -07:00
Sam Lantinga
8796f0a8ed SDL_gtk: Prevent loading GTK-3 if a different version of GTK is already loaded
- gtk_init_check claims it will not terminate the program on failure, however this is does
  not apply to the internal check it performs to see whether another GTK library is already
  loaded, the detection of which triggers a g_error which glib treats as fatal.

- gtk_progress_get_type and gtk_misc_get_type are checked to match the checks done
  by _gtk_module_has_mixed_deps.

- Clean up gtk/gdk loading. There are no library fallbacks so the one option available can
  be loaded rather than iterating through a list of one item.
2025-08-01 17:44:22 -07:00
Sam Lantinga
88cbe85fe2 Added missing files 2025-07-31 08:57:59 -07:00
Ryan C. Gordon
774c0b36ea android: Different approach to SDL_GetPathInfo() for assets.
Reference Issue #13050.
2025-07-29 12:15:25 -04:00
Vicki Pfau
5f4416bc42 joystick: Improve Xbox controller mapping with xpad quirks (#13305)
xpad has a series of questionable design choices when it comes to button
mapping. Notably, BTN_TRIGGER_HAPPY1-4 are used for the D-pad on dance mats
instead of the typical BTN_DPAD_*, and maps the paddles to
BTN_TRIGGER_HAPPY5-8. This commit plumbs through driver detection for a udev
device and adds special exceptions for xpad's quirks.

Newer kernels (6.17+) add the BTN_GRIP* mappings for paddles on controllers. We
should prefer that if available, as its meaning and mapping is unambiguous.
However, since it's only in new kernels, we need to maintain the older mappings
where we know they exist.

It also exposes KEY_RECORD as the share button regardless of vendor, which had
previously been gated behind being a Microsoft controller. All Xbox Series
controllers can include this button, and many third party ones do.
2025-07-28 20:03:51 -07:00