Commit Graph

11078 Commits

Author SHA1 Message Date
Guldoman
ad0d1e2ad5 wayland: Fallback to default cursor if chosen one wasn't found
(cherry picked from commit 5a4283134542d4bdb3d968a836387a750ce80517)
2023-01-06 14:55:06 -08:00
Sylvain
7bf4319eb2
fix computation of alpha in BlitRGBtoRGBPixelAlphaMMX3DNOW (see #6990)
( same as BlitRGBtoRGBPixelAlphaMMX )
2023-01-06 21:24:24 +01:00
Sylvain
0ebda87425 Fixed bug #6990: fix computation of alpha in BlitRGBtoRGBPixelAlphaMMX 2023-01-06 08:50:33 -08:00
Sam Lantinga
a099172754 Added support for the ThrustMaster eSwap PRO Controller Xbox
(cherry picked from commit 0357390fc2dcc7c772ac3041c1148882f6fe2137)
2023-01-03 15:24:32 -08:00
Sam Lantinga
988866ca4a Fixed line wrapping for HID packet dump
(cherry picked from commit e85839cd5694a79f69ac16f48a5d845cdc62f809)
2023-01-03 15:14:00 -08:00
Sam Lantinga
2cb7a0a0bb Added support for the ThrustMaster eSwap PRO Controller Xbox
(cherry picked from commit dacdb1c310d97ca3c3e6492cae0611f86b281b34)
2023-01-03 15:13:50 -08:00
Sam Lantinga
b8d5fa4aef Improved handling of binding buttons and axes
(cherry picked from commit 71f3bf90edce26083056215124e65881f6c6ad26)
2023-01-03 12:50:20 -08:00
Sylvain
0a9f61fbf1
Wayland / Drag and Drop: find the current window 2023-01-03 19:07:28 +01:00
Ozkan Sezer
c7f22f0324 render/SDL_yuv_sw.c: fix build after commit d234f7a 2023-01-02 20:51:56 +03:00
Sylvain Becker
d234f7a498
SDL2: backport SDL_CalculateYUVSize() that checks for YUV size overflow (#6972) 2023-01-02 09:09:57 -08:00
Sylvain
2fd9e63f1a
Android: orientation, check for exact match to "Portrait". (see #6959)
(Portrait is also contained in PortraitUpsideDown)
2023-01-02 09:48:26 +01:00
Sylvain
874ebed14d
Android: inverse LandscapeLeft and LandscapeRight (see #6959)
LandscapeLeft has now been set to ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE and LandscapeRight to ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE in order to reflect the docs: https://wiki.libsdl.org/SDL2/SDL_HINT_ORIENTATIONS
2023-01-02 09:48:17 +01:00
Ozkan Sezer
5b904a103a windows: more HANDLE -> HMODULE changes. 2022-12-31 08:00:20 +03:00
Ozkan Sezer
0a8f9777a7 SDL_dynapi.c: LoadLibraryA() returns HMODULE. 2022-12-30 11:11:10 +03:00
Sam Lantinga
78d3a713de Fixed documentation for SDL_JoystickGetDeviceInstanceID
Fixes https://github.com/libsdl-org/SDL/issues/6946
2022-12-29 15:00:32 -08:00
Sam Lantinga
74229d4a41 Fixed keyboard scancode mapping for parenthesis
(thanks to @meyraud705 for tracking down the root cause!)

Fixes https://github.com/libsdl-org/SDL/issues/6787
Closes https://github.com/libsdl-org/SDL/pull/6937

(cherry picked from commit e1bd5bd071d066e7009261f96c896423f6fd8fd0)
2022-12-29 14:55:46 -08:00
Sam Lantinga
29a4c5ebc2 Fixed getting the VID/PID of a virtual joystick
(cherry picked from commit e40a96155fc488feaeeeb79f947eb43399faa481)
2022-12-28 12:52:17 -08:00
Sam Lantinga
903df79b2d Make sure we match the same way when adding a mapping and looking up a mapping
Fixes https://github.com/libsdl-org/SDL/issues/6898

(cherry picked from commit 3db9112ef4cbb936b11f941f8a98c1704e37e140)
2022-12-27 12:21:13 -08:00
Ozkan Sezer
d47ff8ae73 SDL_thread.h: fix SDL_CreateThreadWithStackSize macro for OS/2 2022-12-27 00:14:00 +03:00
Ozkan Sezer
738442b82a SDL_thread.h: fix beginthread param of SDL_CreateThreadWithStackSize for win32
(cherry-picked from commit 29ba5f5d6426f36ee84304dc8a0e111416450aab)
2022-12-27 00:11:55 +03:00
Vincent Hamm
68073c6276 Fix SDL_CreateThreadWithStackSize not passing staacksize with win32 static api 2022-12-26 11:22:41 -08:00
Sam Lantinga
920acb75c3 editorconfig: remove trailing whitespace in source code
(cherry picked from commit 7c67213cefd0404232ef758a1dc33751e717a3f1)
2022-12-26 10:34:45 -08:00
Sam Lantinga
3dbc6a40ae render: only enable clipping when the rectangle is valid
Fixes https://github.com/libsdl-org/SDL/issues/6896

(cherry picked from commit 00f05dcf49602889733262fc810386592ff51736)
2022-12-26 10:25:23 -08:00
João Henrique
af54c82138 kmsdrm: Fix wrong check on KMSDRM_CreateWindow.
A previous cleanup commit inverted a statement that checked the return value of
a KMSDRM_CreateSurfaces call during KMSDRM_CreateWindow, which causes the video
backend to always fail despite success.

This commit restores the intended behavior.

Fixes: 3c501b963dd8 ("Clang-Tidy fixes (#6725)").
(cherry picked from commit 0187209f461b84d22fc49a03369506e06448f47f)
2022-12-23 09:29:49 -08:00
Rudolf-Walter Kiss-Szakacs
232ed540db Add SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS. 2022-12-22 08:59:56 -08:00
Caleb Cornett
c542aef600 Fix GDK OpenGL build error 2022-12-20 23:22:55 -05:00
Caleb Cornett
abffa1194a Fix dynapi signature for SDL_GDKSuspendComplete 2022-12-20 23:17:50 -05:00
Caleb Cornett
3b3c141ff9 gdk: Add support for building with OpenGL on Xbox 2022-12-19 17:57:17 -05:00
Sam Lantinga
6969b3be3b Don't send Razer devices the Sony third-party query feature report
Some of them lock up or reset, and the vast majority of devices are not actually game controllers.

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

(cherry picked from commit 83b29f9ce1fe6caa06769544c3b5f6c10ea97a0f)
2022-12-19 09:16:59 -08:00
Maido
311b02f0b5
Android active driver check (#6850)
Check if a driver is active before attempting to handle the devices.
Otherwise an assertion will fail.
2022-12-19 16:02:42 +01:00
Sylvain Becker
36c87d9f27
Android JAVA DetectDevices: 'is_capture' is inverted (#6845)
* Android JAVA DetectDevices: 'is_capture' is inversed
* Android Audio: adding audio device. also inverted capture, from jni side
2022-12-18 16:56:43 +01:00
Sylvain Becker
4e3fc0c1dc
Android: make Detect devices common between aaudio and android driver. (#6828)
remove VLA, dynamic alloc, check max length get using GetIntArrayRegion
2022-12-18 12:08:24 +01:00
Sam Lantinga
187708e542 Fixed compiler warning
```
 ./src/thread/pthread/SDL_syssem.c:140:12: warning: variable 'retval' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized]
    while (sem_trywait(&sem->sem) != 0) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/thread/pthread/SDL_syssem.c:149:12: note: uninitialized use occurs here
    return retval;
           ^~~~~~
./src/thread/pthread/SDL_syssem.c:140:12: note: remove the condition if it is always true
    while (sem_trywait(&sem->sem) != 0) {
```

This was a legitimate bug, thank you clang!

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

(cherry picked from commit b678a9802435152324e0603055e4bb190d0ae526)
2022-12-17 06:59:19 -08:00
Sam Lantinga
3b0cd44158 Fixed compiler warning
```
 ./src/joystick/SDL_joystick.c:105:12: warning: no previous extern declaration for non-static variable 'SDL_joystick_lock' [-Wmissing-variable-declarations]
SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */
           ^
./src/joystick/SDL_joystick.c:105:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit
SDL_mutex *SDL_joystick_lock = NULL; /* This needs to support recursive locks */
^
```
1 warning generated.
2022-12-17 06:51:02 -08:00
Maido
741499dea7
Android audio device selection (#6824)
Make it possible to select a specific audio device for Android
2022-12-16 16:38:57 +01:00
Sam Lantinga
a53382e460 Sorted PS4 controllers, note that the NACON Wireless Controller for PS4 actually reports as an XInput device 2022-12-15 18:00:51 -08:00
Sam Lantinga
e99b9ca9c0 Note that the NACON Daija Arcade Stick is an arcade stick 2022-12-15 17:58:29 -08:00
Sylvain
8e72be3117
testime.c: fix wrong {} in switch 2022-12-15 14:39:05 +01:00
Sam Lantinga
7a9966af9d Fixed crash in SDL_PrivateGameControllerRefreshMapping() 2022-12-14 14:24:58 -08:00
Sam Lantinga
d59caffe2c Added support for clang thread-safety analysis
The annotations have been added to SDL_mutex.h and have been made public so applications can enable this for their own code.

Clang assumes that locking and unlocking can't fail, but SDL has the concept of a NULL mutex, so the mutex functions have been changed not to report errors if a mutex hasn't been initialized. We do have mutexes that might be accessed when they are NULL, notably in the event system, so this is an important change.

This commit cleans up a bunch of rare race conditions in the joystick and game controller code so now everything should be completely protected by the joystick lock.

To test this, change the compiler to "clang -Wthread-safety -Werror=thread-safety -DSDL_THREAD_SAFETY_ANALYSIS"
2022-12-14 09:29:19 -08:00
Sylvain Becker
582fb3901a
DBus: add a reference to the connection
Fixed bug #6712
2022-12-14 17:46:52 +01:00
Sam Lantinga
c709741871 Detect display change when fullscreen desktop windows move displays
This happens when using Win+Alt+Left/Right on a resizable fullscreen desktop window on Windows

(cherry picked from commit 650e16a8245f3fb5056fc7f6b398fb88244b3477)
2022-12-12 20:28:07 -08:00
Sam Lantinga
817454cfe6 Don't try to open the Razer Huntsman Elite keyboard as a controller 2022-12-12 18:00:57 -08:00
Ryan C. Gordon
e986c7984b
wasapi: Fixed incorrect assertions.
Fixes #6795.

(cherry picked from commit 12486e144be0e7a37abd87b8bf90547a992ff66b)
2022-12-12 16:08:52 -05:00
Frank Praznik
dfd7efaf13 wayland: Set xdg surface geometry
It was previously thought that these function calls were unnecessary as the initial bug and reproduction case that necessitated their addition seemed to be fixed, but apparently there are still cases where this needs to be set explicitly. Set the xdg surface geometry at creation time and when the window size changes.

Partially reverts #6361.  This is not needed in the libdecor path, as libdecor calls this for the content surface internally.

(cherry picked from commit 90a964f132c63b07cf85e5687041d214fdea60f6)
2022-12-12 11:22:18 -08:00
Sam Lantinga
802b5ef7dc Added support for the STRIKEPAD PS4 Grip Add-on to the HIDAPI driver
(cherry picked from commit 618340bf990512247ed29a1beb38606e371d60e8)
2022-12-12 10:56:08 -08:00
Pierre Wendling
e580e087ff N3DS: Backport semaphore fixes from #6776. 2022-12-11 17:09:28 -08:00
nfarid
b79732b967
cmake: use FindALSA.cmake to find ALSA library 2022-12-11 23:23:45 +01:00
Sylvain
faa7e3cc2e
Update DYNAPI SDL_WinRTRunApp() prototype which was wrong (see #6783) 2022-12-10 19:22:27 +01:00
Sylvain
5efc9bd194
SDL_dynapi_procs: fixed SDL_UIKitRunApp prototype (see #6783) 2022-12-10 19:22:08 +01:00