Commit Graph

855 Commits

Author SHA1 Message Date
Sam Lantinga bc623d1af6 Moved mouse/keyboard detection to a separate thread on Windows
Getting device names can hang for a long time on certain devices, so make sure this is done on a separate thread to avoid blocking initialization and the main loop.

Fixes https://github.com/libsdl-org/SDL/issues/12913
2026-02-16 11:23:14 -08:00
RaceTheMaSe f1a7a64eb4 Fix warnings: Extra semi - macro usage (#15015) 2026-02-08 16:58:53 -08:00
RaceTheMaSe 4f183506f6 Fix warning: strict prototypes (#14992)
clang: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
2026-02-07 07:38:59 -08:00
Max Seidenstücker 8f8880a8eb Merge all occurances of __func__ and __FUNCTION__ to SDL_FUNCTION 2026-02-07 07:34:11 -08:00
Max Seidenstücker d870911202 CodeSpell 2026-02-07 18:14:00 +03:00
Eddy Jansson 23fec649c2 Fix typos in comments. 2026-01-30 07:25:02 -08:00
Eddy Jansson 248223592a More prefer SDL_zero*()
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Transform clearing of arrays into SDL_zeroa(), and
clearing through a T* with size(T) into SDL_zerop().

Extends commit 83fb7b6636.
2026-01-23 16:02:16 -08:00
Eddy Jansson 83fb7b6636 Prefer SDL_zero()/SDL_zerop()
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Replace uses of 'SDL_memset(E, 0, sizeof(E))' and similar
with the SDL_zero()/SDL_zerop() macros.
2026-01-23 11:23:27 -08:00
Sam Lantinga e0659d1956 Call dbus_message_set_no_reply() when not expecting a reply
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-01-22 09:39:59 -08:00
Sam Lantinga 453d3e5c8c Retain the dbus reply when getting string results
The string result points at memory in the reply, so we can't unref that until the string is no longer needed.

Fixes https://github.com/libsdl-org/SDL/issues/14839
2026-01-22 09:39:59 -08:00
Sam Lantinga ce0da58755 Made udev hwdb functionality optional
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2026-01-01 15:39:00 -08:00
Sam Lantinga 4984eb8c16 Use udev to get the manufacturer name if possible (thanks gdb!) 2026-01-01 15:39:00 -08:00
Sam Lantinga 5f086e7623 Updated copyright for 2026 2026-01-01 09:40:08 -08:00
Anonymous Maarten fc4f45f0e3 Updated to version 3.5.0 for development 2026-01-01 17:30:41 +01:00
Sam Lantinga d15ecb21be Updated to version 3.4.1 for development
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2025-12-31 18:18:45 -08:00
Sam Lantinga a962f40bbb Updated to version 3.4.0 for release 2025-12-31 16:43:54 -08:00
Eddy Jansson 3d354eeaad Prefer SDL_arraysize()
Replace uses of (sizeof(arr)/sizeof(arr[0]), and similar,
with the SDL_arraysize() macro.
2025-12-30 12:22:03 -08:00
MAJigsaw77 cb04dcd6f8 android: Add RGB LED support for joysticks. 2025-12-29 10:32:02 -08:00
Simon McVittie b6f4e10bf9 unix: If setuid or setgid, don't use GTK
GTK explicitly doesn't support being used setuid or setgid, and if SDL
loads and initializes GTK, GTK will exit the process if it
detects a setgid executable. This is incompatible with the historical
practice of making game executables setgid in order to write out a
shared high-score table on multi-user systems (which is security theatre
at best, because typical game runtime libraries are not hardened against
an untrusted caller, but making it regress would be a user-observable
regression in sdl2-compat).

Helps: https://github.com/libsdl-org/sdl2-compat/issues/564
Signed-off-by: Simon McVittie <smcv@debian.org>
2025-12-28 10:19:33 -08:00
Simon McVittie 9e0b31b297 unix: Factor out the check for GTK into an internal function
This will allow the same check to be done by the libdecor integration.

Helps: https://github.com/libsdl-org/sdl2-compat/issues/564
Signed-off-by: Simon McVittie <smcv@debian.org>
2025-12-28 10:19:33 -08:00
Anonymous Maarten 9dd3e2305e dlnote: embed trailing semicolon in SDL_ELF_NOTE_DLOPEN macro 2025-12-24 23:45:50 +03:00
Sam Lantinga d583fc88be Updated to version 3.3.7 for development 2025-12-16 09:38:05 -08:00
Sam Lantinga ef0a604d44 Updated to version 3.3.6 for preview release 2025-12-16 08:54:04 -08:00
Sam Lantinga 518c98ea01 Pass the window along with evdev touch events
Fixes https://github.com/libsdl-org/SDL/issues/14644
2025-12-15 08:29:36 -08:00
Sam Lantinga 7773157fae Updated to version 3.3.5 for development
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2025-12-07 09:30:04 -08:00
Sam Lantinga f173fd28f0 Updated to version 3.3.4 for preview release 2025-12-06 14:57:22 -08:00
Ethan Lee b74ba6298c Xbox buildfix for IsWindowsBuildVersionAtLeast 2025-12-06 15:34:17 -05:00
Anonymous Maarten eda8d1d842 JNI_Unload must return the JNI version needed by the native library 2025-11-26 14:04:02 +01:00
Ryan C. Gordon 9b348ef6e8 android: Better parsing of command line arguments.
Reference Issue #14510.
2025-11-25 15:29:48 -05:00
Ryan C. Gordon 17ab859907 main: Unify command line handling between standard Windows and GDK targets.
Reference Issue #14510.
2025-11-24 10:04:09 -05:00
eafton 36976ecb43 X11TK: Introduce Thai support and rewrite/cleanup messagebox positioning code (#14474) 2025-11-20 15:26:46 -08:00
Sam Lantinga cc768f3e88 Allow opening asset paths starting with "./"
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
Fixes https://github.com/libsdl-org/SDL/issues/13933
2025-11-18 15:29:04 -08:00
Ozkan Sezer a882afafe5 fixed several -Wzero-as-null-pointer-constant warnings from gcc-15 2025-11-17 17:55:10 +03:00
Ryan C. Gordon d66946cee7 wasapi: fix memory leak on unlikely failure case. 2025-11-13 20:58:21 -05:00
Ryan C. Gordon 7db0e48454 wasapi: Minor style tweaks. 2025-11-13 20:58:21 -05:00
Sam Lantinga e2e8f86076 Check for wine_get_version() to detect Wine/Proton
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
If this application is being run under Wine but Steam doesn't know that, Steam won't set STEAM_COMPAT_PROTON. So we'll use wine_get_version() to detect that we're running under Wine instead.
2025-11-12 22:29:42 -08:00
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)
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
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
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
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
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
2025-10-23 22:41:03 -07:00
Sam Lantinga b31c4b70b3 Updated version and documentation for 3.3.2 preview release
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
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
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled
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