Sam Lantinga
c77aaa5d99
Fixed n3ds build
...
(cherry picked from commit d95dbe78bb )
2023-06-12 15:41:09 -07:00
Sam Lantinga
e4e0a12901
Reduce the chance of destroying the joystick mutex while it's in use
...
Fixes https://github.com/libsdl-org/SDL/issues/7811
(cherry picked from commit 6390165fd4c193631d6780758a4aeec0d02b90eb)
2023-06-12 15:31:16 -07:00
Ryan C. Gordon
2afb49ba9a
cocoa: Warp mouse to center of window before enabling relative mouse.
...
This prevents the case where the mouse might be at the edge of the
window when enabling relative mode, which confuses macOS, at it
might believe the user is attempting to resize the window.
Fixes #6994 .
2023-06-11 12:47:26 -04:00
Ozkan Sezer
154ad6faa9
SDL_dynapi.c: minor cosmetics.
2023-06-10 20:50:10 +03:00
Sam Lantinga
2aa8525ecb
Fixed build
2023-06-10 09:29:09 -07:00
Sam Lantinga
36033e3832
Make it clear that you can't mix 2D rendering and the window surface API
...
Also added functions to query and destroy the window surface so you can switch between modes if you want.
See https://github.com/pygame-community/pygame-ce/issues/2190 for more details.
2023-06-10 08:54:36 -07:00
Sam Lantinga
320f3fffbe
Fixed querying device info on the MOBAPAD M073
...
The query packet needs to contain valid rumble data in order to be accepted by the controller.
Fixes https://github.com/libsdl-org/SDL/issues/7788
(cherry picked from commit 5490873daa )
2023-06-09 18:43:14 -07:00
Sam Lantinga
30b4d90f1c
Only update the serial number if it hasn't already been set
...
This fixes the serial number for Nintendo Switch Pro, which is queried from the hardware in device initialization, and was later clobbered by the USB string which isn't correct.
(cherry picked from commit 2042e9c4e3 )
2023-06-09 17:36:06 -07:00
Sam Lantinga
1cdd6dc829
Fixed reading input from the Razer Atrox Arcade Stick using Windows Gaming Input
...
(cherry picked from commit 172cfca51332a845abf9c141ae56aa121fe4ada5)
2023-06-09 14:36:12 -07:00
Ozkan Sezer
f5b3247aae
further mouse relative motion fix for os/2 (thanks Andrey Vasilkin)
2023-06-08 03:40:32 +03:00
Ryan C. Gordon
aa536217b3
x11: check if window size/position has changed during SDL_ShowWindow.
...
Fixes #4216 .
(cherry picked from commit 49b5cfa6c5 )
2023-06-07 15:46:59 -04:00
Ozkan Sezer
b1324fbc9f
fixed os/2 mouse relative motion not working (thanks Andrey Vasilkin,)
...
for issue reported at https://github.com/bitwiseworks/SDL2-os2/issues/5
2023-06-05 11:50:50 +03:00
Sam Lantinga
4700fbcbdf
Don't bother re-encoding Latin1 characters in the ASCII range
...
(cherry picked from commit 6150b5b3cb )
2023-06-04 05:40:07 -07:00
Eddy Jansson
2660da6f5c
Always allocate zt in output of SDL_iconv_string()
...
Before this, the function could not be used on buffers,
as it would not account for the zero-termination unless
it was included in the input.
(cherry picked from commit 5f5abb6805 )
2023-06-04 05:17:15 -07:00
Sam Lantinga
7c86d96e86
Fixed SDL_iconv_string() truncation when handling SDL_ICONV_E2BIG
...
(cherry picked from commit c369b90019 )
2023-06-04 05:14:44 -07:00
Ozkan Sezer
a1dea11d32
fix MSVC build error.
2023-06-04 14:29:10 +03:00
Sam Lantinga
bfef7c302c
Only convert the result of XLookupString() if it's not already UTF-8
...
Fixes https://github.com/libsdl-org/SDL/issues/7766
(cherry picked from commit 491ae20d96 )
2023-06-04 02:54:21 -07:00
Sam Lantinga
dc94cca8dd
Fixed typo in cherry-pick (thanks @HadesD!)
2023-06-03 11:57:08 -07:00
Sam Lantinga
97fe777ab4
Steam uses a different VID/PID for the Steam Virtual Gamepad on Windows
...
(cherry picked from commit 6815e75caf )
2023-06-03 11:40:58 -07:00
Sam Lantinga
f1bad83a21
Revert "Fixed detection of the Steam Virtual Gamepad on macOS"
...
This reverts commit 7aa28ce279 .
Steam has been updated to send a version of 1 to avoid conflicts with controllers that report a version of 0.
2023-06-03 11:36:38 -07:00
Sam Lantinga
7aa28ce279
Fixed detection of the Steam Virtual Gamepad on macOS
...
(cherry picked from commit 5fcd70578b )
2023-06-02 18:39:22 -07:00
Sam Lantinga
c89a460672
Fixed build if SDL_JOYSTICK_RAWINPUT_MATCHING isn't enabled
...
(cherry picked from commit 7c55845c80 )
2023-06-02 11:20:55 -07:00
Sam Lantinga
e3bfacde3e
Don't use raw input while Remote Desktop is active
...
Raw input will not send game controller events while Remote Desktop is active, so dynamically switch between XInput and raw input when Remote Desktop state changes.
Fixes https://github.com/libsdl-org/SDL/issues/7759
(cherry picked from commit 767507fcf6 )
2023-06-02 11:19:44 -07:00
Sam Lantinga
9c05098ed9
Fixed WGI immediately being correlated with raw input devices with no input
...
The at rest match state is 0x0000008800000000, not 0
(cherry picked from commit e8b5b4881c )
2023-06-02 09:39:57 -07:00
Alibek Omarov
68e3e99087
wayland: reset orientation bitmask before reading values from hint on QtWayland
...
Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com >
2023-06-02 07:41:08 -07:00
Ryan C. Gordon
379a6f4dab
x11: Attempt to wait for SDL_MaximizeWindow to complete before returning.
...
Fixes #7070 .
2023-05-30 17:04:31 -04:00
Ryan C. Gordon
d275851dfb
windows: Don't allow non-resizable windows to be maximized.
...
Fixes #6346 .
2023-05-29 14:47:53 -04:00
Sam Lantinga
5007b96363
Fixed build warning
2023-05-28 19:23:56 -07:00
Sam Lantinga
b2e88ecfeb
Disable SDL_JOYSTICK_RAWINPUT_XINPUT
...
Apparently when using the Xbox One Wireless Adapter, using XInput at the same time as raw input will cause the controller to turn off immediately after connecting. This appears to be a bug in the Windows 11 driver stack, but since WGI provides all the extended functionality we need, this can be turned off for now.
Fixes https://github.com/libsdl-org/SDL/issues/3468
2023-05-28 18:41:21 -07:00
Anonymous Maarten
d6cd450624
windows: SDL_Delay expects a 32-bit integer
2023-05-27 02:34:41 +02:00
Anonymous Maarten
e875775940
windows: SDL_immdevice needs SDL_timer.h include
2023-05-27 02:10:18 +02:00
Ryan C. Gordon
48e71ae87b
wasapi: Deal with HDMI or DisplayPort-based audio devices.
...
They can vanish for UP TO EIGHT SECONDS...!
This is for devices that connect to HDMI/DisplayPort/etc, where it
presumably has to wait for a display to get up and running before it
can play audio through it, so one can see the audio device fail when
changing display modes, or the system returning from sleep. Since this
can be triggered by a game changing video resolutions at startup (either
before or after opening the audio device!), it's important to deal with.
In normal conditions, it shouldn't take this long to open or recover an
audio device, but this is better than unexpectedly losing the device
in this situation.
Fixes #7044 .
Fixes #5571 .
2023-05-26 19:15:28 -04:00
Sam Lantinga
7308325559
Added support for printing wide strings using "%ls" syntax
...
(cherry picked from commit 128ca70160 )
2023-05-26 14:59:30 -07:00
Anonymous Maarten
c68976360d
Fix -Wunused-function warning when configuring with -DSDL_X11_XINPUT2=OFF
2023-05-26 15:28:58 -04:00
Ryan C. Gordon
a535cc62a0
video: Only specify some GL context attributes if not the explicit default.
...
Just in case it upsets some OpenGL drivers unnecessarily.
Fixes #7730 .
(cherry picked from commit d4bc393efe )
2023-05-25 10:10:03 -04:00
Sam Lantinga
3f1fd5abff
Updated source to match SDL function prototype style
2023-05-23 10:59:03 -07:00
Frank Praznik
891c89eeb8
Fix unused variable warnings
2023-05-23 11:15:48 -04:00
Frank Praznik
e2b8d96529
wayland: Validate surfaces and window data before sending touch events
...
Ensure that incoming touch events originate from valid surfaces owned by SDL and have proper window data before forwarding them to the touch subsystem, or the window focus pointer that is sent with the event may not be a pointer to an SDL window.
2023-05-23 10:31:28 -04:00
Sam Lantinga
78a92b4f9d
Fixed duplicate Joy-Con controllers on macOS
...
If both Apple and HIDAPI drivers see the controller, HIDAPI will be preferred.
Fixes https://github.com/libsdl-org/SDL/issues/7479
(cherry picked from commit 61ef4efdfa )
2023-05-22 14:52:05 -07:00
Sam Lantinga
7b2b99a996
Fixed handling the Saitek P3600, which doesn't use the Xbox 360 controller protocol
...
(cherry picked from commit cf0abf9911 )
2023-05-22 12:42:05 -07:00
Sam Lantinga
a2f4783e75
Don't map the top keyboard row to numbers when using the one-handed DVORAK layouts (thanks @tormol!)
...
Fixes https://github.com/libsdl-org/SDL/pull/5127
2023-05-22 11:30:42 -07:00
Caleb Cornett
2001a891c4
Fix Xbox link error from IsRectEmpty
...
(cherry picked from commit 376a3cd100 )
2023-05-21 19:11:25 -07:00
M. P. Halpin
1ee9a437f9
Stop beep when running iOS apps on ARM-based Macs
...
(cherry picked from commit bbf38bbbc3 )
2023-05-20 11:21:13 -07:00
Sam Lantinga
69644346ac
Added the hint SDL_HINT_ENABLE_SCREEN_KEYBOARD to control whether the on-screen keyboard should be shown when text input is active
...
Fixes https://github.com/libsdl-org/SDL/issues/7160
2023-05-20 11:09:36 -07:00
Sam Lantinga
00b87f1ded
Make sure the sentinel is at the end of the current event pump cycle
...
If we're waiting, it's possible to not get any events, then add the sentinel, then pump again and then add another sentinel. We want to make sure we only have one sentinel and that it's at the end of the currently pumped events.
Testing:
* Verified test case in https://github.com/libsdl-org/SDL/issues/6539
* Verified test case in https://github.com/libsdl-org/SDL/issues/5350
Fixes https://github.com/libsdl-org/SDL/issues/6539
2023-05-20 10:27:48 -07:00
Sam Lantinga
beca41480d
Undo name change for the controller list
...
(cherry picked from commit f60622c510 )
2023-05-19 14:27:06 -07:00
Sam Lantinga
43b12fd9bc
Moved the controller list out so it can be included elsewhere
...
(cherry picked from commit 24007b00b2 )
2023-05-19 14:23:57 -07:00
Sam Lantinga
e8ec8ba1d4
Added support for the Astro C40 in Xbox 360 mode
...
(cherry picked from commit a4b4dff4a2 )
2023-05-19 14:23:57 -07:00
Ozkan Sezer
92a487f2e4
style fixes for SDL_PROC macros.
2023-05-19 14:10:02 +03:00
Ryan C. Gordon
df9d0fb332
power: On Linux, compare status strings as case-insensitive.
...
In case something reports "Device" when we expected "device", etc.
Reference Issue #6835 .
2023-05-18 13:26:55 -04:00