Commit Graph

14268 Commits (4e60fc9b2b189cad83dc3d5f75ced9c55fbfc411)

Author SHA1 Message Date
Alynne cae657140c Add Access Controller 2023-12-26 09:58:09 -08:00
Sam Lantinga 74418e1aa8 Made the cursor list check a compile time assert instead of a runtime one
This will catch this being out of date more quickly in the future
2023-12-26 09:57:11 -08:00
Sam Lantinga d6fb0d91d8 Added testpen to the Visual Studio solution 2023-12-26 09:55:09 -08:00
Susko3 bbdd41f287 Fix windows touch using wrong axis for normalisation
Regressed with 9302d7732d
2023-12-26 09:12:17 -08:00
Susko3 a28ac29aa0 Add missing cursor types
The flowing assert would trip:
    SDL_assert(SDL_arraysize(cursorNames) == SDL_NUM_SYSTEM_CURSORS)
2023-12-26 09:12:17 -08:00
Tyson Whitehead 6daf2e943f Try SDL_UDEV_deviceclass to detect joysticks even if in a container
The udev container issue is mostly to do with device notifications
and netlink. The device classification stuff just pokes file in /sys
and /run/udev. Doesn't hurt to try it first for classifying joysticks
and then fall to the guess heuristics if it fails.
2023-12-24 22:39:16 -08:00
Sam Lantinga 1bf78ed544 We get a resize event when the view enters fullscreen mode on iOS
The call stack is:

We want to use this instead of the desktop mode because the view may be in a different orientation than the device orientation, which the desktop mode is based on.
2023-12-24 17:45:35 -08:00
Sam Lantinga e3b5999bb4 Use the application requested size to determine automatic orientation on iOS
Fixes https://github.com/libsdl-org/SDL/issues/8201
2023-12-24 17:14:16 -08:00
Sam Lantinga 278e3f9184 Whoops, fixed setting fullscreen flag 2023-12-24 17:12:01 -08:00
Sam Lantinga 69e60e0f1b Fixed setting fullscreen mode on iOS
Needed to update the actual window flags based on the requested state (@Kontrabant)
2023-12-24 16:24:22 -08:00
Sam Lantinga 0e5ea3cc4b Fixed infinite recursion when adding an accelerometer as joystick on iOS
Fixes https://github.com/libsdl-org/SDL/issues/8716
2023-12-24 11:19:16 -08:00
Sam Lantinga c3d84c3342 Record the initial input report mode and only restore simple mode if that's what we started with
Fixes https://github.com/libsdl-org/SDL/issues/8108
Closes https://github.com/libsdl-org/SDL/pull/8115
2023-12-24 08:12:14 -08:00
Julian Uy 10a8b750a0 Use common generic syscond for platforms with no cond implementation 2023-12-24 06:52:42 -08:00
Julian Uy 4914e5bb78 PS2 use WaitSemaEx for waiting for semaphore with timeout 2023-12-24 06:52:27 -08:00
Sam Lantinga bb0e0ae080 Added a runtime check for BLUETOOTH_CONNECT in addition to BLUETOOTH (thanks @perepujal!)
Fixes https://github.com/libsdl-org/SDL/issues/8731
2023-12-24 06:50:42 -08:00
Sylvain 312f98c2a1 Make sure the string is terminated, fixed invalid read in SDL_PrivateParseGamepadConfigString() 2023-12-23 12:55:21 -08:00
Frank Praznik 199f7cc3b1 x11: Ignore border extents when the border hint is unset
Old extent events can arrive after the border hint has been unset. Ignore the reported values in this case to avoid reporting bogus border sizes.
2023-12-22 12:19:28 -05:00
SDL Wiki Bot 07e9603398 Sync SDL3 wiki -> header 2023-12-22 17:14:22 +00:00
Sylvain ffd82fb7c4 Add scaleMode to SDL_SoftStretch(), remove SDL_SoftStretchLinear(). 2023-12-22 09:13:21 -08:00
Sylvain 5dba04b29b Remove SDL_{Set,Get}SurfaceScale().
Add Scale parameter to SDL_BlitSurfaceScaled() and SDL_BlitSurfaceScaledUnchecked()
(see #8732)
2023-12-22 02:08:49 -08:00
Frank Praznik e66896406d cocoa: Set appropriate flags on fullscreen spaces windows
Don't mark fullscreen windows as having a title bar if the window is borderless, or it can end up in a weird, pseudo-decorated state when leaving fullscreen if the borders were toggled back on while the window was fullscreen.

Setting the window styling when about to leave fullscreen caused issues with this as well and is no longer needed, as it is ensured that the window's resizable state won't change while in a fullscreen space, or in a transition period.
2023-12-21 17:44:23 -05:00
Frank Praznik 57fcb9044c video: Remove more assumptions about window state in the video layer
Don't check the fullscreen flag when toggling resizable, bordered, always on top, minimum size and maximum size, as the flag doesn't reflect pending async changes that may be in progress.

These properties can be made to be safely toggled while the window is in fullscreen mode and applied when returning to windowed mode, which ensures that requested window settings aren't lost if calling these functions while async fullscreen changes are in flight.
2023-12-21 17:44:23 -05:00
Dimitriy Ryazantcev cb90653695 win32: use USER_DEFAULT_SCREEN_DPI instead of explicit 96 value 2023-12-21 08:32:10 -08:00
Lukas Senionis a2e05480d6 Use crc16 return value when calculating GUID
Fixes the regression introduced by 919cd56b20c59249bdde3bb005aeeb8f6550f3e3
2023-12-21 07:00:13 -08:00
Sam Lantinga 2ad50e9675 Make the SDL3 surface ABI compatible with SDL2
We'll use properties for new data associated with a surface, which lets us preserve ABI compatibility with SDL2 and any surfaces created by applications and passed in to SDL functions.
2023-12-21 06:58:22 -08:00
Sam Lantinga f72d6a7fd9 Use more verbose names for properties, to match upcoming public property names 2023-12-21 06:58:22 -08:00
Sam Lantinga 1f1ee6f77c Use the original manufacturer and product strings for the joystick CRC
This allows the most information possible for the CRC string, which is used to differentiate controllers with the same VID/PID.

Fixes https://github.com/libsdl-org/SDL/issues/8724
2023-12-20 19:22:37 -08:00
Sam Lantinga 4bb5e1f0f9 Added migration notes for migrating Steam Input support from SDL2 to SDL3 2023-12-20 14:15:09 -08:00
Sylvain 56f111dffc Fix compilation / same as sdl2-compat
testautomation_platform.c:351:28: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  351 |     result = SDL_SetError("%s", testError);
      |                            ^~
/home/slvn/release/Release_SDL/sdl2-compat/test/testautomation_platform.c:364:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  364 |                             "SDL_GetError(): expected message '%s', was message: '%s'",
2023-12-20 22:28:50 +03:00
Sam Lantinga 72c366bf3d Fixed whitespace 2023-12-20 11:06:34 -08:00
Dimitriy Ryazantcev 3152b98e87 win32: minor fixup in WIN_UpdateKeymap()
Remove unused defines in SDL_windowsevents.c
2023-12-20 11:01:45 -08:00
SDL Wiki Bot 2c4360ce8f Sync SDL3 wiki -> header 2023-12-20 18:41:23 +00:00
Sam Lantinga c981a597dc Added Steam Input API support for game controllers
Added support for getting the real controller info, as well as the function SDL_GetGamepadSteamHandle() to get the Steam Input API handle, from the virtual gamepads provided by Steam.

Also added an event SDL_EVENT_GAMEPAD_STEAM_HANDLE_UPDATED which is triggered when a controller's API handle changes, e.g. the controllers were reassigned slots in the Steam UI.
2023-12-20 10:40:28 -08:00
Vicki Pfau a8f4f40d08 Sync more Steam Controller header definitions for the Steam Deck 2023-12-19 20:18:37 -08:00
Sam Lantinga e6e54b22c8 Ignore all surface comparison output files in the testautomation directory 2023-12-19 08:48:44 -08:00
Sam Lantinga 9d13be743b Make sure we're rendering whenever the activity might be visible, even if we don't have focus.
This fixes rendering when a system dialog is over the application
2023-12-18 19:21:00 -08:00
Frank Praznik 69ec0322d3 win32: Make leaving fullscreen when the window already isn't fullscreen a no-op
Otherwise, the styling on external windows may end up being overridden.
2023-12-18 11:47:59 -05:00
Frank Praznik 8f79e0b7f8 win32: Fix high-DPI debug logging 2023-12-18 11:31:37 -05:00
Sylvain a4496f7dcf Update doc: SDL_SoftStretch() and SDL_SoftStretchLinear() #8667 2023-12-18 06:35:52 -08:00
Dimitriy Ryazantcev 43309d38ed joystick: Extract 0x02a9 and 0x0291 PIDs into separate defines.
Cleanup controller list comments block.
2023-12-18 05:43:38 -08:00
Sylvain 84a0d5f623 Added SDL_SetSurfaceScaleMode() and SDL_GetSurfaceScaleMode() to control scale mode using SDL_BlitSurfaceScaled() 2023-12-17 15:39:53 -08:00
Sam Lantinga 4d5949dcf6 Added a controller name for the Steam virtual gamepad 2023-12-17 10:07:46 -08:00
Sam Lantinga 695846f2ed Pass through the name of the controller for the XInput mapping 2023-12-17 09:33:53 -08:00
Frank Praznik 1745289b1b x11: Don't move the window when restoring and ensure that resize and position events are sent when entering or leaving fullscreen
Account for the border sizes when restoring the window and only turn off resize events when entering or leaving fullscreen until the frame extents are changed, and only if they are, or previously were, non-zero.

This necessitated further refinement to the sync algorithm as well, but as a result, the sync function no longer occasionally times out if creating a window and immediately recreating it when initializing a renderer, and some rare, spurious size and position failures in the centered window and state automated tests seem to be fixed.
2023-12-17 11:39:49 -05:00
Dimitriy Ryazantcev 08a7ca4d53 XInput: Use XInputGetCapabilitiesEx instead of fragile GuessXInputDevice
XInputGetCapabilitiesEx (ordinal 108) is available in XInput 1.4 that is shipped with Windows 8 and newer.
2023-12-17 08:32:10 -08:00
Sam Lantinga 7f75178908 Verify that the %p format specifier works for 64-bit pointers 2023-12-17 08:14:20 -08:00
Sam Lantinga 72b7acfe8a Don't create a TLS error buffer if we're just clearing the error
Fixes https://github.com/libsdl-org/SDL/issues/7600
2023-12-16 21:28:43 -08:00
Matt Guerrette 240e7747c8 Fix #8702: Add SDL_hidapi_steamdeck.c to Xcode target
This commit fixes a linker issue when building SDL 3.0 using Xcode
2023-12-16 20:25:33 -08:00
Frank Praznik b937c54b66 win32: Set all size and position variables for external windows 2023-12-15 16:41:20 -05:00
Sam Lantinga 8c285828e5 Fixed return value for SDL_UDEV_AddCallback()
Fixes https://github.com/libsdl-org/SDL/issues/8694
2023-12-15 10:06:01 -08:00