Commit Graph

12468 Commits

Author SHA1 Message Date
Sam Lantinga
e08edab180 Log object leaks at debug level
End users don't care about this. Developers can enable debug logs, run with DEBUG_INVOCATION=1, or use other leak checking tools to detect these.
2025-10-25 15:13:37 -07:00
Sam Lantinga
ffd0ca4391 Perform full rectangle intersection for empty rects
If we don't do that, we leave the x and y values uninitialized.

Fixes https://github.com/libsdl-org/sdl12-compat/issues/365
2025-10-25 13:48:48 -07:00
Frank Praznik
acaf53926c wayland: Destroy the seats before stopping the cursor surface event thread
Stopping the thread also destroys the queue used by pointer surfaces, and if any seats still have a surface associated with the queue at that time, it will cause a libwayland warning. Destroying the seats first ensures that all surfaces associated with the thread queue are destroyed before the queue is destroyed.
2025-10-25 12:54:20 -04:00
Gleb Mazovetskiy
38df1c3138 miniz.h: do not overallocate out_buf 2025-10-25 07:44:15 -07:00
DONGGEUN YOO
093fbfd867 Fix uninitialized length in X11_GetClipboardData causing test failures (#14322) 2025-10-25 07:41:58 -07:00
Gleb Mazovetskiy
ac0915bdb5 miniz.h: fix PNG compression when pitch != w 2025-10-25 01:24:14 -07:00
Frank Praznik
537e92b158 wayland: Synthesize repeated keys after processing events
Otherwise, long delays between pumping events can result in repeating keys that were already lifted some time ago.
2025-10-24 15:51:01 -04:00
Sam Lantinga
51b401d418 Fixed OTP text entry on iOS (thanks @pipiwoaini!)
Fixes https://github.com/libsdl-org/SDL/issues/13717
2025-10-24 11:02:37 -07:00
Sam Lantinga
404ec13fbb Fixed building with libusb on FreeBSD 2025-10-24 10:41:08 -07:00
Frank Praznik
3149533f0c wayland: Remove unused struct member 2025-10-24 13:37:20 -04:00
Sam Lantinga
d2c6aeea7d Add the bundle framework path to the libMoltenVK.dylib paths
Fixes https://github.com/libsdl-org/SDL/issues/14313
2025-10-24 10:33:22 -07:00
Dmitry Marakasov
42ce72be3c Fix libusb get_port_numbers signature for FreeBSD 2025-10-24 08:26:17 -07:00
Sam Lantinga
be781fc8f5 Updated to version 3.3.3 for development 2025-10-23 22:41:03 -07:00
Frank Praznik
39aedcef64 events: Pump DBus messages in the main event loop
DBus does not require a video backend, and DBus messages still need to be processed even when a video backend is not initialized. Move the DBus pump call to the main event message pump function so that DBus events are still dispatched, even when a video backend has not been initialized.
2025-10-23 21:03:09 -04:00
Sam Lantinga
b31c4b70b3 Updated version and documentation for 3.3.2 preview release 2025-10-23 15:20:26 -07:00
Sam Lantinga
1fa6475c90 Added support for saving indexed PNG images
Fixes https://github.com/libsdl-org/SDL/issues/14303
2025-10-23 12:40:41 -07:00
Ozkan Sezer
02c4478f93 SDL_ConvertSurface: clear sdl2-compat.surface2 on the converted surface
Fixes https://github.com/libsdl-org/sdl2-compat/issues/534
2025-10-23 08:24:23 +03:00
Sam Lantinga
e18d63a4e2 Added SDL_RotateSurface()
Fixes https://github.com/libsdl-org/SDL/issues/14269
2025-10-22 17:55:02 -07:00
Sam Lantinga
a402af506c Removed SDL_FILE from source code 2025-10-22 10:52:18 -07:00
Sam Lantinga
f79ede100b Removed __FILE__ from source code 2025-10-22 10:48:36 -07:00
Sam Lantinga
999f782ad3 Be more selective when blacklisting controller touchpads
On Android, the PS4 controller is called "Wireless Controller Touchpad"
Fixes https://github.com/libsdl-org/SDL/issues/14294
2025-10-22 10:44:08 -07:00
Sam Lantinga
e58648d592 Removed call to ID3D11DeviceContext1_DiscardView() (thanks @pipiwoaini!)
This is unnecessary and can cause issues after a resize or device removal.

Fixes https://github.com/libsdl-org/SDL/issues/14283
2025-10-21 13:01:30 -07:00
Ryan C. Gordon
2056c54548 kmsdrm: Allow windows to be marked as "unfocusable".
In this case, it means a newly-created window on a specific display won't
get mouse/keyboard input (which, presumably, will continue to go to a window
on a different physical display instead).

This also makes SDL_SetWindowFocusable() functional on the kmsdrm backend, to
change this flag later, but to be clear, there are no window focus events to
jump between displays in this backend, so this is only useful to manually
tweak things later.

Fixes #14289.
2025-10-21 14:10:49 -04:00
Sam Lantinga
9d32e0e881 Fixed data alignment for PNG cursors (thanks @Kontrabant!) 2025-10-21 10:50:09 -07:00
Sam Lantinga
af6f517453 Use CreateIconFromResource() for all cursors (#14285)
This allows us to properly adjust the size for DPI scaling and both static and animated cursors have consistent behavior.

Fixes https://github.com/libsdl-org/SDL/issues/14281
2025-10-21 09:38:26 -07:00
Frank Praznik
41039b44ac wayland: Ensure that the main queue is dispatched when showing a libdecor window
There is no guarantee that libdecor will always dispatch the main queue (a future plugin may run on its own queue), so ensure that the main queue is still dispatched when showing a libdecor window, as is already the case when pumping events.
2025-10-21 11:49:17 -04:00
Frank Praznik
c84ac6d6bc wayland: Fix a race condition in the color management event handlers
The queue running on the cursor thread might flush color events before their queue has been set. Use proxy wrappers for their parent objects to assign the queue atomically at creation time.
2025-10-21 11:24:22 -04:00
Frank Praznik
35cc58e027 wayland: Run cursor animations on a thread
If the main event handling thread runs slowly, so will cursor animations. Use a dedicated thread for cursor surface events, so that animations will always run at a consistent rate.
2025-10-21 09:56:18 -04:00
Frank Praznik
776d11a9c8 wayland: Remove unnecessary flushes
Events are implicitly flushed during blocking dispatches and round-trips. Remove some unnecessary uses of wl_display_flush().
2025-10-21 09:40:38 -04:00
Frank Praznik
bfa89b3d5f wayland: Refactor event processing
Clean up and implement some best practices for event polling and handling:

- Ensure that events are still pumped, even if existing events are in the queue, to ensure that the most recent data is always processed.
- Handle wl_display_flush returning EAGAIN by trying to poll the socket until it can be written to.
- Ensure that events are always pumped on interrupts and broken pipe errors to handle quit events.
- Minimize double-pumping of events, since returning a success code from a wait will implicitly pump events again.
- Wake to poll when using a DBus IME, but the text input protocol is not enabled, to ensure that text events are delivered.
2025-10-21 09:40:36 -04:00
Katelyn Gadd
9479ac039c If VULKAN_Submit fails during VULKAN_INTERNAL_CreateTexture, destroy the texture and return NULL 2025-10-20 16:24:20 -07:00
Frank Praznik
7c110cb0f1 wayland: Convert alternate images to ARGB8888
The higher-level functions only convert the base image, so alternate scaled images for icons and cursors need to be converted when being copied to the buffers.
2025-10-20 19:00:29 -04:00
Victor Ilyushchenko
544772173f fix crash in Cocoa when SDL_RedrawCursor sends NULL to ShowCursor
Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
2025-10-20 18:08:27 -04:00
Ryan C. Gordon
91a5598283 cocoa: Check for duplicate proximity events.
Fixes #12137.
2025-10-20 15:55:24 -04:00
Frank Praznik
3669920fdd win32: Set the number of frames correctly when caching a scaled animated cursor
Fixes #14284
2025-10-20 13:26:19 -04:00
Sylvain
128baec810 Add option "--quit-after-ms N" to automatically quit application after N ms 2025-10-20 08:41:24 -07:00
Eddy Jansson
3b0347ac48 Don't do NULL-checks before free() 2025-10-20 00:13:09 -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
Sam Lantinga
2f810e0a5f Copy properties when converting a surface to a new format
This fixes retaining the cursor hotspot when converting cursor frames to SDL_PIXELFORMAT_ARGB8888
2025-10-19 23:51:19 -07:00
Sam Lantinga
23fcf53c53 Treat a single frame animated cursor as a normal color cursor 2025-10-19 23:03:54 -07:00
Sam Lantinga
bd86e85249 Added fallback support for animated cursors 2025-10-19 22:53:10 -07:00
Sam Lantinga
0e87ba163f Fixed crash if the animated cursor had a NULL frame 0 2025-10-19 22:53:10 -07:00
Sam Lantinga
cae27a0ec7 Set an error if a cursor image is too large 2025-10-19 18:25:05 -07:00
Frank Praznik
95c0b49de0 x11: Check for a valid video device pointer before dereferencing the name 2025-10-19 18:39:44 -04:00
Frank Praznik
bad5dced3e x11: Ensure that parent windows for a dialog are from the X11 driver
If the system doesn't have Zenity installed, message boxes can fall back to the X11 toolkit while the Wayland driver is in use, in which case, a Wayland window may be set as a parent to an X11 dialog. Ensure that the parent window for an X11 dialog is actually an X11 window.
2025-10-19 18:16:50 -04:00
Ryan C. Gordon
1fe926769c kmsdrm: Restore atomic support. 2025-10-19 14:22:56 -04:00
Sylvain
e4c60c05bf Fixed bug #14233 - Android fix Android_WaitActiveAndLockActivity() to make sure Android_Paused state is refreshed 2025-10-19 07:43:51 -07:00
TheSniperFan
cbcb145eb4 Fix debug mode being set too late
-Early error messages were always being skipped
2025-10-18 08:04:11 -07:00
Vicki Pfau
d635a064aa switch2: Read out serial number 2025-10-18 07:57:30 -07:00
Vicki Pfau
e4b763f9f8 switch2: Enable grip buttons on charging grip 2025-10-18 07:57:30 -07:00