Commit Graph

4350 Commits

Author SHA1 Message Date
Christian Rauch
9e6fcbe72c wayland: client-side decoration 2021-07-25 14:54:12 -07:00
Christian Rauch
e5f9fae034 wayland: don't flush after setting fullscreen 2021-07-25 14:54:12 -07:00
Mathieu Eyraud
8e604a5f12 Fix error handling in X11_SetWindowTitle
X11_XChangeProperty return 1 on success.
2021-07-25 14:51:33 -07:00
Jaylon Gowie
bc3b98f3ed Replace with SDL_SendKeyboardKeyAutoRelease 2021-07-25 07:41:30 -07:00
Jaylon Gowie
5cd37c0a7b Add Enter Key support to PSVita IME keyboard 2021-07-25 07:41:30 -07:00
Sam Lantinga
10ec4c8671 Added support for the PowerA Nintendo Switch Spectra Controller 2021-07-24 22:11:22 -07:00
Sam Lantinga
3c9559f765 Don't try to rumble third-party Nintendo Switch Pro controllers
Sending rumble to the PowerA Spectra Nintendo Switch controller hangs input reports for a couple of seconds.
2021-07-24 19:43:56 -07:00
Sam Lantinga
cc19b13bc3 Fixed missing return statement 2021-07-24 19:21:29 -07:00
Sam Lantinga
d4ac6b5ed9 Detect buffer overflow when getting DirectInput device state
This fixes bug https://github.com/libsdl-org/SDL/issues/4528
2021-07-24 15:58:33 -07:00
Sam Lantinga
3b85e3fdfc Fixed internal Windows key state when using Windows+Space or Windows+G shortcuts
This fixes bugs:
https://github.com/libsdl-org/SDL/issues/4369
https://github.com/libsdl-org/SDL/issues/4500
2021-07-24 15:47:11 -07:00
Sam Lantinga
03c19efbd1 Added support for multiple seats with touch input on Wayland
This fixes bug https://github.com/libsdl-org/SDL/issues/4517
2021-07-24 15:25:50 -07:00
Sam Lantinga
ff1b5e1bf7 Implemented the window flash operations for X11 2021-07-24 15:11:36 -07:00
Ryan C. Gordon
5ae0dd4b52
joystick: Split out Linux opening code for reuse by querying code.
This prevents an assertion whem LINUX_JoystickGetGamepadMapping tried to
open the stick temporarily and messed with global state by doing so. Now
the global state is only set in LINUX_JoystickOpen, but the common code
is shared by both interfaces.

Fixes #4198.
2021-07-24 17:48:26 -04:00
Sam Lantinga
f1633127d1 Added a window flash operation to be explicit about window flash behavior 2021-07-24 13:42:19 -07:00
Joel Linn
b2c8d3e9e4 audiocvt: 5.1 to Stereo conversion utilizing AVX 2021-07-24 15:39:17 -04:00
Joel Linn
638befc1a9 audiocvt: 5.1 to Stereo conversion utilizing SSE 2021-07-24 15:39:17 -04:00
Joel Linn
db56526f14 audiocvt: Replace divisions
Division is expensive and the compiler can not replace it themselves.
Though we now we will be ok in terms of floating point edge behaviour.
2021-07-24 15:39:17 -04:00
Sam Lantinga
e1c3a25034 Changed SDL_FlashWindow() so it doesn't take a flash count, and added the hint SDL_HINT_WINDOW_FLASH_COUNT to control behavior on Windows 2021-07-24 12:11:27 -07:00
Sam Lantinga
09d1cea733 Use the new controller type for the Luna and Stadia controllers 2021-07-24 11:15:09 -07:00
Sam Lantinga
808c3ae612 Allow mapping Android controllers that just have a D-PAD and face buttons
This fixes bug https://github.com/libsdl-org/SDL/issues/4327
2021-07-24 10:37:42 -07:00
Sam Lantinga
94b7a87645 Added SDL_GameControllerType enumerations for the Amazon Luna and Google Stadia controllers
Fixes bug https://github.com/libsdl-org/SDL/issues/4019
2021-07-24 09:10:18 -07:00
german77
e6e8fe6d4e hidapi_switch: Implement analog rumble 2021-07-24 01:06:05 -07:00
Sam Lantinga
669714cafe Added the ThrustMaster T.16000M as a flightstick 2021-07-23 23:51:35 -07:00
Sam Lantinga
384d86b584 Fixed compile warnings with Visual Studio 2021-07-23 23:48:23 -07:00
Sam Lantinga
adb75d642c Fixed hotplug detection not working on UWP or when SDL isn't pumping Windows events
This fixes bugs:
https://github.com/libsdl-org/SDL/issues/4321
https://github.com/libsdl-org/SDL/issues/4147

Thanks to DJm00n for the suggestion!
2021-07-23 23:45:18 -07:00
Sebastian Krzyszkowiak
7b0092db6a vita: touch: Mark the back panel as an indirect absolute touch device
It's not a touchscreen, but an additional touch panel on the back of
the device.
2021-07-23 16:40:34 -07:00
Sam Lantinga
422b053b96 Added support for the full line of current PowerA Xbox Series X controllers 2021-07-23 16:32:35 -07:00
Jaylon Gowie
48bbe31bc6 Add PreSwapCallback for updating SceCommonDialog 2021-07-21 09:41:10 -07:00
Jaylon Gowie
9c1306bc5e Add elgext.h header 2021-07-21 09:41:10 -07:00
meyraud705
4ada14a267 Replace libc functions to SDL equivalent in wayland video subsystem
Wayland video subsystem uses a mix of libc and SDL function.
This patch switches libc functions to SDL ones and fixes a mismatch in memory
allocation/dealoccation of SDL_Cursor in SDL_waylandmouse.c (calloc on line 201
and SDL_free on line 313) which caused memory corruption if custom memory
allocator where provided to SDL.
2021-07-21 09:28:38 -07:00
Ivan Epifanov
f806064e7e Remove 'support' for rgb/bgr textures, that was causing issues with them 2021-07-19 10:14:13 -04:00
Niklas Haas
d6641d7123 kmsdrm: Explicitly set the surface transform and alpha mode
This is required by the specification. Set these to sensible defaults.
Fixes a validation layer error that occurs otherwise.
2021-07-19 10:12:54 -04:00
Niklas Haas
760074270a kmsdrm: Properly zero-initialize CreateInfo structs
As written, these contain undefined stack contents, which in practice
causes crashes/hangs and/or triggers the validation layers (they
complain about `pNext` and `flags` not being NULL).
2021-07-19 10:12:54 -04:00
Ivan Epifanov
817976da69 VITA: Rewrite and fix RenderCopyEx rotation 2021-07-13 08:45:33 -07:00
Sam Lantinga
dc6f044309 Added mapping for the Xbox Series X controller on tvOS 2021-07-12 17:57:21 -07:00
Sam Lantinga
947ad6e13a Added support for the Xbox Series X controller on iOS and tvOS 2021-07-12 17:57:21 -07:00
Brick
7fe6dbafa3 Reset rawInputEnableCount when RawInput is not supported 2021-07-11 14:51:31 -07:00
Sam Lantinga
24059a19c5 The RAWINPUT driver is no longer tied to HIDAPI in any way 2021-07-09 18:11:42 -07:00
Sam Lantinga
f93e9047eb Implemented the timeout in hid_read_timeout() on Android
This fixes detecting PS5 controllers connected over USB
2021-07-08 18:44:50 -07:00
Hanseul Jun
557d0f827f Commenting a false alarm in WIN_GLES_SetupWindow.
When hint SDL_HINT_OPENGL_ES_DRIVER is set to "1" (e.g. for ANGLE support), assertion due to !_this->gl_config.driver_loaded can be causes while EGL is available.
2021-07-08 14:49:40 -07:00
Sam Lantinga
d135c0762f Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow applications to send custom effects to the PS4 and PS5 controllers
See testgamecontroller.c for an example of a custom PS5 trigger effect
2021-07-08 13:22:41 -07:00
Ozkan Sezer
3da6d2cdde WIN_SetErrorFromHRESULT: kill CR/LF that FormatMessage sticks at the end
Fixes: https://github.com/libsdl-org/SDL_mixer/issues/320
2021-07-08 20:33:50 +03:00
Dean Herbert
8fb95034e8 Avoid warping the cursor to the center of the window when not in relative_warp_mode
When relative mode is enabled and not using warp mode, the cursor is
being clipped to the window. Therefore there is no reason to restore the
cursor position to the center.

Avoiding the warp to center simplifies mouse position event flow, as we
are no longer potentially receiving mouse events for the automated
movement of the cursor and can be (mostly) assured that an incoming
event from the windowing system is that of external means.
2021-07-08 09:27:09 -07:00
Dean Herbert
4359a47b3e Simplify ClipCursor behaviour when RelativeMouseMode is enabled
The implementation of clip logic for relative mode seemed to
unnecessarily limit the usable area to the middle of the window, in a
2x2 pixel region. This has the adverse side effect of moving the
operating system cursor to that location, even if it is in a valid
location in the window.

While in most scenarios this is handled correctly (by storing the
original position of the cursor in the window and restoring when leaving
relative mode), there are edge cases where this clip operation can cause
WM_MOUSEMOVE to fire at a point in time where it counts as a relative
delta from SDL's perspective.
2021-07-08 09:27:09 -07:00
Dean Herbert
3720e254c4 Trim some stray whitespace 2021-07-08 09:27:09 -07:00
Austin Shafer
16e3bfe807 SetDisplayMode: Call XRRSetScreenSize before setting CRTC config
X11_SetDisplayMode currently calls X11_XRRSetCrtcConfig alone. This results
in the monitor's viewport getting changed, but the underlying screen dimensions
stay the same.

The spec indicates that RRSetCrtcConfig only changes the crtc mode and has no effect
on the screen dimensions, only mentioning that the new crtc must fit entirely within the
screen size. For the size to change, RRSetScreenSize also needs to be called.

This affects Metro Exodus on Linux, when changing the resolution in the in-game settings
Metro gets stuck in a loop waiting for the size of its vulkan surface to change. Because
XRRSetScreenSize is not called the screen size is never changed, the vulkan surface dimensions
do not change, and Metro hangs forever watching for a surface size update that will
never come.

This change disables the CRTC, calls XRRSetScreenSize, and then updates the
CRTC configuration. This fixes changing the resolution from the Metro settings.

Tested with:
Metro Exodus, Portal 2
2021-07-08 08:41:29 -07:00
Sam Lantinga
4a20dd3e54 Removed unnecessary comment, the mic button is in byte 16 on all firmware versions 2021-07-08 07:38:18 -07:00
Sam Lantinga
46f19c311d Implemented mouse relative mode for iOS 14.1 and newer 2021-07-08 07:23:29 -07:00
Sam Lantinga
430bbcb87f Added HIDAPI support for the Amazon Luna Controller connected over USB in DirectInput mode 2021-07-07 09:49:33 -07:00
Sam Lantinga
863f566941 Fixed reading thumbstick axes and mic button on the Amazon Luna Controller firmware version 305164320 2021-07-07 08:55:16 -07:00