13774 Commits

Author SHA1 Message Date
Sam Lantinga
9458cbf75e Removed unused SDL_OSEvent 2023-11-07 09:14:35 -08:00
Frank Praznik
1a57f6bb29 wayland: Remove QtWayland extensions
These were added a very long time ago and seem to serve no purpose now, as the functionality they provided is now in core Wayland protocols, current information on their usage and status is nonexistent, no modern compositor seems to support them, and the code paths are untested and subject to bit-rot at this point. It also causes duplicate symbol issues when statically linking an application to both Qt and SDL.
2023-11-07 11:00:32 -05:00
Ozkan Sezer
5f920d6639 fix emscripten build after commit 07cb7c10 2023-11-07 07:55:30 +03:00
Sam Lantinga
22016b4eae Enable the 5th player LED on the DualSense controller
Fixes https://github.com/libsdl-org/SDL/issues/5152
2023-11-06 20:14:50 -08:00
Sam Lantinga
66cf30c2de Removed misleading comment
Fixes https://github.com/libsdl-org/SDL/issues/5069
2023-11-06 19:33:40 -08:00
Sam Lantinga
dbcd390cdf Log drag and drop position updates in SDL test programs 2023-11-06 18:53:06 -08:00
Sam Lantinga
07cb7c10a1 Fixed connecting and disconnecting real-joysticks closing virtual joysticks in Emscripten (thanks David!)
Emscripten was using its own, private integer in order to allocate
new SDL_JoystickIDs.  SDL keeps a similar integer for allocating
joystick-ids, one which is shared across multiple joystick backends.

SDL 2.0.13 introduces a new joystick-backend, a Virtual joystick
backend, which allows for software-driven joysticks, and which is
designed to sit alongside joystick-backends that provide access to
physical joysticks.

The Emscripten and the Virtual backends were, at times, getting
allocated the same SDL_JoystickIDs, if and when both backends were used
simultaneously.  This could happen if, for example, an application
was using a virtual joystick in order to drive a touch-screen
based joystick, while also supporting physical joysticks through the
Emscripten backend.

When two joysticks end up with the same SDL_JoystickID, conflicts
can occur.  For example, disconnecting a physical joystick with
the same SDL_JoystickID as a virtual one, can lead to the virtual
joystick being closed, inadvertently.

This fix makes the Emscripten backend use SDL's cross-joystick-backend
integer counter, which is shared among joystick backends, for allocating
new SDL_JoystickIDs, rather than a private, Emscripten-specific
counter.

Fixes https://github.com/libsdl-org/SDL/issues/3647
2023-11-06 17:12:51 -08:00
Ryan C. Gordon
869257a5c1
SDL_migration.cocci: Added a thing for SDL_Vulkan_CreateSurface. 2023-11-06 19:16:38 -05:00
Ryan C. Gordon
c6d9fb1ad7
hidapi: Avoid memcpy'ing to NULL.
(This fix was originally from @themightyoarfish on GitHub. Thanks!)

Fixes #8428.
Reference PR #8431.
2023-11-06 13:48:07 -05:00
Ryan C. Gordon
4d1aecc225
vulkan: Patched to compile on iOS. 2023-11-06 13:35:19 -05:00
SDL Wiki Bot
fccec65afe Sync SDL3 wiki -> header 2023-11-06 18:32:15 +00:00
Ryan C. Gordon
2f92807087
vulkan: SDL_Vulkan_CreateSurface now accepts an app-provided allocator.
Fixes #3638.
2023-11-06 13:31:20 -05:00
Ryan C. Gordon
c53843a961
docs: Remove Doxygen \brief tags.
Doxygen and the wiki bridge don't need them; they'll both just use the first
line/sentence instead.

Fixes #8446.
2023-11-06 10:26:06 -05:00
Ozkan Sezer
c132295ad7 SDL_FlushEventMemory is not a public procedure. 2023-11-06 17:40:56 +03:00
Ryan C. Gordon
7ac281f800
Sync wiki -> headers. 2023-11-06 09:33:05 -05:00
Sam Lantinga
f7d40b7594 Added 10-bit pixel formats in addition to SDL_PIXELFORMAT_ARGB2101010
Added SDL_PIXELFORMAT_XRGB2101010, SDL_PIXELFORMAT_XBGR2101010, SDL_PIXELFORMAT_ABGR2101010

Fixes https://github.com/libsdl-org/SDL/issues/3553
2023-11-06 00:41:09 -08:00
Sam Lantinga
3e4d7e48b0 Fixed memory leak in XInput code
Fixes https://github.com/libsdl-org/SDL/issues/3597
2023-11-06 00:40:19 -08:00
Sam Lantinga
bc3d9e99f3 Only save ibus_addr_file after we've successfully read an address from it.
Fixes https://github.com/libsdl-org/SDL/issues/3359
2023-11-05 22:12:37 -08:00
Sam Lantinga
04dfca958a Added a note to events indicating that memory is owned by SDL 2023-11-05 21:25:43 -08:00
Sam Lantinga
20cd789bab Improved migration documentation for the event memory change. 2023-11-05 21:20:48 -08:00
Anonymous Maarten
459f17257c cmake: fix MSVC unrecognized option link warning 2023-11-06 01:58:26 +01:00
Anonymous Maarten
761390b62f cmake: detect linker id, and assume MSVC does not support version scripts 2023-11-06 00:41:00 +01:00
Ozkan Sezer
d2e005ee13 dynapi: remove duplicated SDL_LoadWAV entries 2023-11-05 20:32:50 +03:00
Frank Praznik
21ff699251 test: Fix popup test crash on exit
If the done signal is emitted by the common event handler, the window and all of its children have already been destroyed, so don't try to render with invalid renderer objects.
2023-11-05 12:29:22 -05:00
Sam Lantinga
70c149c88f Automatically clean up memory associated with events 2023-11-05 09:14:11 -08:00
Ozkan Sezer
1a83bf2399 fix a possible memory leak in SDL_vasprintf() 2023-11-05 20:01:02 +03:00
Jamie Madill
59b37d0e5b
cmake: fix Windows unrecognized option link warning
This fixes a warning that could show up on some MS linkers which use a
slightly different warning message than expected.

Amends check_linker_supports_version_file to include the "unrecognized
option" warning message.
2023-11-05 16:28:22 +00:00
Sam Lantinga
9302d7732d Fixed touch normalized coordinates
When converting normalized coordinates to pixel coordinates, the valid range is 0 to (width or height) - 1, and the pixel coordinate of width or height is past the edge of the window.

Fixes https://github.com/libsdl-org/SDL/issues/2913
2023-11-05 06:55:39 -08:00
SDL Wiki Bot
ff3c20a799 Sync SDL3 wiki -> header 2023-11-05 14:11:05 +00:00
SDL Wiki Bot
17a0fe3a0c Sync SDL3 wiki -> header 2023-11-05 14:06:05 +00:00
SDL Wiki Bot
14d2471a8f Sync SDL3 wiki -> header 2023-11-05 14:04:05 +00:00
SDL Wiki Bot
2ad22eeeb5 Sync SDL3 wiki -> header 2023-11-05 14:02:06 +00:00
Sam Lantinga
930438dfb7 Added note that the #ifdef is for !__IOS__ 2023-11-05 00:33:08 -07:00
kanjitalk755
c56583fe45 Fix duplicate symbol on iOS/tvOS 2023-11-05 00:31:27 -07:00
kanjitalk755
2b62f25a6f Add SDL_sysmain_callbacks.c to the Xcode project 2023-11-05 00:31:27 -07:00
kanjitalk755
4ab31ca678 Fix dropping file event 2023-11-05 00:14:56 -07:00
Sam Lantinga
5dce4bc716 Makes SDLInputConnection and DummyEdit public classes (thanks Cole!)
I've added an additional patch that expands on the same basic idea as the first one; it makes SDLInputConnection and DummyEdit into public classes so that they can be overridden from the Xamarin end if their functionality needs to be extended. (In my case, I need to change the type of software keyboard that's displayed.)

Fixes https://github.com/libsdl-org/SDL/issues/2785
2023-11-04 23:22:55 -07:00
Sam Lantinga
d3f2eb2aba Use XINPUT_STATE instead of XINPUT_STATE_EX (thanks Andrew!)
XINPUT_STATE_EX isn't actually a thing, we can just use the normal XINPUT_STATE

Fixes https://github.com/libsdl-org/SDL/issues/2797

(cherry picked from commit e8f4045d0bccacbf8f4b716d0dde17140e9f2cc4)
2023-11-04 22:28:09 -07:00
Sam Lantinga
3a482ebae0 Add createSDLMainRunnable() to SDLActivity (thanks Cole!)
This patch adds a new createSDLMainRunnable() method to SDLActivity.

Currently, SDL on Android expects to find SDL_main somewhere in native code. When using SDL in a Xamarin application, however, what we really want to do is write our entrypoint in managed code. The easiest way to do this is to allow subclasses of SDLActivity to provide their own Runnable to the SDL thread, as in the attached patch.

Fixes https://github.com/libsdl-org/SDL/issues/2785
2023-11-04 21:18:16 -07:00
Sam Lantinga
b9784feb24 Fixed potential uninitialized memory access (thanks Mathieu!)
GetRawInputDeviceList() can return a different number of devices than was allocated.

Fixes https://github.com/libsdl-org/SDL/issues/2759
2023-11-04 21:11:53 -07:00
Sam Lantinga
75ea3a8d32 Dynamically allocate long text for SDL_EVENT_TEXT_INPUT events
This prevents input text from being split across Unicode combining or modifier characters, and in practice allocations will rarely happen.
2023-11-04 20:55:10 -07:00
Sam Lantinga
2a1660ab51 Additional cleanup for SDL_RWprintf() (thanks @sezero!) 2023-11-04 20:47:08 -07:00
Ryan C. Gordon
e5f2cea234
Sync wiki -> headers 2023-11-04 22:18:38 -04:00
Sam Lantinga
ad842dd5ad Fixed a typo in SDL_log.h 2023-11-04 16:46:08 -07:00
Sam Lantinga
f9d11807c0 Added SDL_RWprintf() and SDL_RWvprintf() to do formatted printing to an SDL_rwops stream
Fixes https://github.com/libsdl-org/SDL/issues/2390
2023-11-04 16:46:08 -07:00
Frank Praznik
52c4e3eab3 events: Update self-referential pointers when copying event objects
Pointers to static internal data need to be updated when copying events, or the cleanup code will attempt to free old stack data that went out of scope.
2023-11-04 18:07:24 -04:00
Sam Lantinga
91f0456391 Add the source application for drag and drop events (thanks Nathan!)
This is only implemented on iOS, but is useful for third party application integrations.

Fixes https://github.com/libsdl-org/SDL/issues/2024
2023-11-04 13:00:41 -07:00
Ryan C. Gordon
1a8bf31a69 include: Fixing whitespace on SDL_MixAudioFormat. 2023-11-04 15:06:41 -04:00
Sam Lantinga
d07a264a9b Use the default UCS2/UCS4 conversion rather than non-portable INTERNAL encoding
Fxies https://github.com/libsdl-org/SDL/issues/1497
2023-11-04 12:01:30 -07:00
Ryan C. Gordon
780b6612a9 wayland: Wayland_Vulkan_GetInstanceExtensions didn't set the count variable.
Fixes #8468.
2023-11-04 14:53:24 -04:00