20093 Commits

Author SHA1 Message Date
Frank Praznik
51ce3f8c8d x11: Filter mouse wheel events from "Master" devices
Discard wheel events from "Master" devices to avoid duplicates, as wheel events are stateless and can't be deduplicated.
2025-08-02 18:56:41 -04:00
Frank Praznik
42463569d5 GPU: Vulkan backend flags command buffer for cleanup when swapchain is requested
When skipping presentation due to the window being hidden, presentDataCount is not incremented on the command buffer, and subsequently the submitted command buffers will not be cleaned up as long as the window is hidden. This results in a lag spike when showing the window due to all previously submitted command buffers suddenly being cleaned up at once, and lag at shutdown due to an equivalent number of fences needing to be destroyed.

Instead of relying on presentDataCount to determine whether a command buffer should be cleaned up, use a flag, which is set under the appropriate circumstances.
2025-08-02 09:24:02 -07:00
Petar Popovic
ae5ce258cf Fix double-free warning in src/hidapi/linux/hid.c 2025-08-02 07:08:35 -07:00
Antheas Kapenekakis
2b94062482 sinput: fix compiling with debug output on 2025-08-02 06:37:27 -07:00
Anonymous Maarten
5dc801506b ci: Haiku does not need -DSDL_UNIX_CONSOLE_BUILD=ON
Haiku has a native video system
2025-08-02 03:39:38 +02:00
Anonymous Maarten
2190705754 ci: configure with -DCMAKE_SYSTEM_NAME=Haiku for Haiku
Fixes ci regression introduced in e8b69b03fe
2025-08-02 03:08:03 +02: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
Ozkan Sezer
f241e8e8fd windows: replace shobjidl_core.h usage with shobjidl.h except for when targeting xbox
Closes https://github.com/libsdl-org/SDL/pull/13571
2025-08-01 17:11:49 -07:00
capehill
1c5c3b1479 Fix SDL_BlitSurfaceScaled crash
SDL_BlitSurfaceScaled could crash when passed large coordinates, due
to final_dst.w or final_dst.h getting negative values.
2025-08-01 09:22:20 -07:00
Antheas Kapenekakis
d04899fcfd Fix setting RGB without a player led (#13524)
There is a bug where SInput checks for player led capability before
setting RGB. This means that if a controller does not have a player led,
RGB commands are not sent.
2025-08-01 09:15:54 -07:00
Petar Popovic
1749aba641 Fixed a few "-Wredundant-decls" warnings 2025-08-01 18:35:02 +03:00
Frank Praznik
550d95e04f wayland: Cleanup an outdated conditional and comment
There may have been a reason for not attaching a null buffer when destroying a popup at some point in the past, but that is unnecessary now, as is the comment about ShowWindow crashing, as ShowWindow assures that a null buffer is attached before (re)creating the window.
2025-08-01 10:33:55 -04:00
A1029384756
9034375d2f wayland: reorder surface destruction to avoid premature blanking 2025-08-01 10:20:19 -04:00
Ozkan Sezer
83818eeb95 tests: c90 fixes (#endif comments) for consistency after commit 9e37839 2025-08-01 06:28:02 +03:00
Anonymous Maarten
9e3783996b Fix testnative C90 compatibility 2025-08-01 02:27:54 +02:00
Anonymous Maarten
7b501ae71f Add a few include guards to private headers 2025-08-01 02:00:08 +02:00
Anonymous Maarten
06cafa3040 cmake: explicitly disable UNITY_BUILD property for SDL3 libraries 2025-08-01 01:59:18 +02:00
Petar Popovic
09221820f6 Fix potential memory leak in SDL_render_gles2.c 2025-07-31 16:18:47 -07:00
Matthew Zavislak
dc2c83c383 Support Google Play 16 KB Page Size Requirement (#13470)
- See: https://developer.android.com/guide/practices/page-sizes#update-packaging
- Also, make min API uniform at 21 (from 16 and 23 in a few places)
2025-07-31 16:12:54 -07:00
cosmonaut
c5edf4bd5b GPU: Bail out of aquiring Vulkan swapchain if window is hidden 2025-07-31 16:02:58 -07:00
mitchellcairns
6d580d74f2 Fix Axis Inputs for Generic SInput Device (#13489)
- Implement correct SInput generic mapping string to map analog axes
- Implement 6 axis count fallback for generic SInput Device
2025-07-31 15:36:10 -07:00
Sam Lantinga
2989d0c420 Fixed build 2025-07-31 10:18:05 -07:00
Frank Praznik
b0cdb7143f wayland: Adjust popup adjoining check
The previous calculation could result in a window whose original position was positioned exactly corner-to-corner with the parent not being adjusted to be adjoining, and thus subject to spurious closure.
2025-07-31 12:13:28 -04:00
Sam Lantinga
88cbe85fe2 Added missing files 2025-07-31 08:57:59 -07:00
Sam Lantinga
26c41f3f9a Fix Android build
- Android defines SDL_PLATFORM_UNIX but does not compile core/unix sources
  so add checks for SDL_PLATFORM_ANDROID where SDL_gtk is used.

- Fix missing void parameter list in SDL_Gtk_EnterContext.

- Remove unneeded SDL_gtk.h include in SDL_events.c
2025-07-31 08:49:40 -07:00
Sam Lantinga
bf7b4d4a9e x11: Add GTK signal handler for gtk-xft-dpi and reader in GetGlobalContentScale
- This is to support dynamic updates of content scale when running in XWayland. The GTK signal is
  preferred over the XSettings watcher and Xrm database if supported as it will trigger and update
  for both native X11 and XWayland on changes to Xft.dpi.
2025-07-31 08:49:36 -07:00
Sam Lantinga
3c369aa8b4 unix: Refactor GTK bindings from SDL_tray to separate SDL_gtk module to allow shared usage
- SDL creates and requires usage of a specific glib context. This context is set as the global
  glib context with SDL_Gtk_EnterContext and the previous context is restored with
  SDL_Gtk_ExitContext.

- To avoid changing the behavior of SDL_tray, which is the only consumer of SDL_gtk currently,
  the SDL_UpdateTray function now unconditionally runs a single glib frame iteration and is
  responsible for dispatching glib events for all consumers in SDL_PumpEvents.

- Cleaned up some error handling in SDL_tray.
2025-07-31 08:49:31 -07:00
Cheney Wang
d8ac51859e GPU: Fix wrong Vulkan swapchain size when retrying acquire 2025-07-30 15:34:56 -07:00
Wouter Wijsman
3d1a28ccf2 psp: fix audio not playing 2025-07-30 13:11:05 -07:00
Thaddeus Crews
3195980b49 Define relevant macros when LACKS_ERRNO_H is true 2025-07-30 09:11:11 -07:00
Stefan Schlosser
10458f2cac SDL_getenv.c: fix dynamic loading of environ symbol on FreeBSD
The current implementation uses the returned address of the `dlsym` function
directly to load the `environ` symbol. But this function doesn't return the
address to the symbol itself, instead it returns the address to the location
where the actual address is stored, i.e. it's an additional indirection.
Consequently, the implementation fails to load and process the environment
variables successfully.

One example where this error shows up is in the `Dialog API`: in an `X11`
environment, the `zenity` driver requires access to the user's `DISPLAY` and
`XAUTHORITY` environment variables. Because these variables aren't transfered
to the `zenity` process, no dialogs are shown. This can be exercised in the
`test/testdialog.c` testprogram.

The fix changes the indirection level of the `dlsym` call from `char **` to
`char ***`, does a `NULL`-check in case the call failed, and returns the
dereferenced actual adress to the `environ` symbol.
2025-07-30 07:06:25 -07:00
SDL Wiki Bot
e2392984b2 Sync SDL3 wiki -> header
[ci skip]
2025-07-30 08:06:30 +00:00
Ryan C. Gordon
dec21043a0 docs: Slightly improve virtual joystick docs.
Reference https://github.com/libsdl-org/sdlwiki/issues/78
2025-07-30 00:52:29 -04:00
Ryan C. Gordon
ea04bdb5f3 docs: Added a note about virtual joysticks to CategoryJoystick.
Fixes https://github.com/libsdl-org/sdlwiki/issues/78
2025-07-30 00:44:35 -04:00
Sam Lantinga
c663b6ec1f Don't leave garbage in output parameters 2025-07-29 20:48:56 -07:00
SDL Wiki Bot
cd15893ea3 Sync SDL3 wiki -> header
[ci skip]
2025-07-30 03:30:05 +00:00
Ryan C. Gordon
acbe86399d docs: Note SDL_EVENT_AUDIO_DEVICE_ADDED is sent for all devices at startup.
Fixes https://github.com/libsdl-org/sdlwiki/issues/721
2025-07-29 23:22:50 -04:00
SDL Wiki Bot
39794ae9cd Sync SDL3 wiki -> header
[ci skip]
2025-07-30 03:13:02 +00:00
SDL Wiki Bot
d9b578312e Sync SDL3 wiki -> header
[ci skip]
2025-07-30 03:04:38 +00:00
Evan Hemsley
07af4b237b GPU: Fix incorrect block size when D3D12 uniform buffer is rotated (#13469) 2025-07-29 15:34:08 -07:00
Petar Popovic
f27dbb22f0 Fix two use-after-free warnings 2025-07-29 12:29:19 -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
Petar Popovic
beea8d604e Replaced binary integer literals with hexadecimal integer literals 2025-07-29 06:34:38 -07: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
Sam Lantinga
25cf1a569c Map GameCube controller trigger clicks as misc3 and misc4
This is for consistency with the GC Ultimate controller and allows binding in Steam
2025-07-28 13:11:07 -07:00
SDL Wiki Bot
c8ebbb3e92 Sync SDL3 wiki -> header
[ci skip]
2025-07-28 18:58:19 +00:00
Xen
b3ba1c159e Update SDL_clipboard.h
Typo fixes and a small addition to SDL_SetClipboardData about mime_type list usage clarity.
2025-07-28 11:57:25 -07:00
Dan Andrus
30f0aeb26a Check NSWindow::isVisible before sending SDL_WINDOWEVENT_RESTORED during Cocoa_WindowListener::windowDidResize 2025-07-28 14:47:08 -04:00
Mitch Cairns
49b6bb50c9 Remove Unused Type 2025-07-28 11:05:44 -07:00
Mitch Cairns
2b0b794f86 SInput Generic Types
- Implements 'handheld' flag to indicate whether the SInput device is a gamepad or handheld (ROG Ally etc)
- Implements generic mapping fallback along with face style setting ability
2025-07-28 11:05:44 -07:00