Commit Graph

11479 Commits

Author SHA1 Message Date
Ozkan Sezer
3e341021c3 fixed typo in prev. patch. 2023-07-28 07:35:14 +03:00
Ozkan Sezer
1ecf77d630 test/testnativecocoa.m: fixed deprecation warnings. 2023-07-28 07:21:14 +03:00
Sam Lantinga
507be6c3f8 Sorted controller list
(cherry picked from commit 3174d0b97025376e4a7b6e881501a43472238e0e)
2023-07-27 12:49:24 -07:00
Max Maisel
f4561db69a Add Steam Deck controller mapping to database.
This adds support for the back paddles, and the "..." key
which are not automatically detected.
* "Back" is mapped to the top left "two windows" key.
* "Start" is mapped to the top right "hambuger menu" key.
* "Guide" is mapped to the "Steam" key.
* The "..." key is just a generic button.

When looking at the screen, paddles are number
* P1: Top right
* P2: Top left
* P3: Bottom right
* P4: Botom Left

The new controller mapping was created with the SDL3 gamepadmap tool.

(cherry picked from commit 27b8abb0562f46e64337d5d799b877c357001254)
2023-07-27 12:49:24 -07:00
Anonymous Maarten
2b0ca87119 SDL_atomic.h: __ARM_ARCH is not always defined for an arm platform
e.g. riscos toolchain
(cherry picked from commit 8105f1d5b5b83328f4d0017a562674efca821077)
2023-07-26 20:39:20 +03:00
Sam Lantinga
37d1ab83c5 Make sure the mouse and keyboard focus is cleared when a window is hidden
(cherry picked from commit a16b241b8937db7701fce6c1f410e3af84f8c4e6)
2023-07-25 11:50:54 -07:00
Ozkan Sezer
e7761aec37 update docs/README-os2 after the last os/2 audio patch. 2023-07-25 20:51:32 +03:00
Ozkan Sezer
890bee64a4 os2 audio refactoring and capture support
- Fixed audio device detection and usage.
- Implemented audio capture support
- Refactored buffer handling to separate pointers to fill and drain buffers.

Based on patches by josch1710 and Lars Erdmann:
https://github.com/bitwiseworks/SDL2-os2/pull/7
2023-07-25 11:40:02 +03:00
Sam Lantinga
ba0c270c7a Removed invalid assert in testatomic
(cherry picked from commit 8adab0b88ab1c0aa69242fffc48afdba085b1dc4)
2023-07-22 18:40:31 -07:00
Anonymous Maarten
322dbdde4e ci: bump mymindstorm/setup-emsdk to latest tag 2023-07-22 17:36:27 +02:00
Weng Xuetian
64294e4560 Remove the unimplemented CloseIC in fcitx module
This call is actually a left-over when porting from fcitx4 service to the new org.freedesktop.portal.Fcitx supported by both fcitx4/fcitx5. CloseIC is actually never a part of the new interface on org.freedesktop.portal.Fcitx. It cause any issue user visible effect.
2023-07-20 13:37:13 -07:00
Sam Lantinga
c4c034ca4b Don't fail to create a window if it's too large, just clamp it to the max instead
Some window is better than no window...

(cherry picked from commit 4a18893c73a4a6b963384e186c1b70c6f6cb08a4)
2023-07-17 17:48:56 -07:00
Sam Lantinga
f7dc8c0eaa Fixed LED pending check failing when the controller timestamp is very large
In this case we know the controller has been on for a while and the Bluetooth connection LED cycle is complete.

Also fixed the timestamp being zero the first time it is checked

(cherry picked from commit bd4f155bbbdc4be34505535e4bd936ae12671925)
2023-07-17 17:40:17 -07:00
Sam Lantinga
bb036ef544 Don't send k_EPS5FeatureReportIdCapabilities to Sony PS5 controllers
This report is for third party controllers only.

(cherry picked from commit 16dd5f0da4ee950e9f998a757dcb4789463e67e2)
2023-07-17 17:39:33 -07:00
Sam Lantinga
910dad505a Don't tickle Bluetooth PS5 controllers in simple mode with an effects packet
That will put the PS5 controller into enhanced mode, which breaks DirectInput games

(cherry picked from commit 2fef0be2f646ae048e239aa6694e632081c85238)
2023-07-17 17:36:41 -07:00
Ozkan Sezer
4b2b475ac2 remove unused vulkan/*.hpp files.
(cherry picked from commit 611b3dd1fd7aec30ba9c830c7c5f8a0cdbaf9ff5)
2023-07-17 00:11:51 +03:00
Sam Lantinga
a4ad293d4a Relicensed testutils to match other test code
Permission granted in 76a7b629bf (commitcomment-121408342)

(cherry picked from commit 6c2472d459602eb3c3ee109d6e8f255336109673)
2023-07-16 04:37:15 -07:00
Sam Lantinga
6089b35706 Fixed getting the CRC of virtual joysticks without a VID/PID
(cherry picked from commit b40fb5c51e2a5350ba00fbf4db86b4ae1066db92)
2023-07-16 04:36:06 -07:00
Frank Praznik
a999100858 wayland/video: Validate the returned window display pointer before dereferencing it
If, in the case where all displays has been disconnected, and some window state change occurs before an active display is re-added and finalized, the pointer returned by SDL_GetDisplayForWindow() will be null necessitating that the returned pointer be checked for validity before dereferencing it.
2023-07-14 10:43:54 -04:00
Anonymous Maarten
57e9a9eee6 ci: move 'set -eu' to after source_cmd 2023-07-14 15:02:10 +02:00
Ryan C. Gordon
b9d16dac4e
pulseaudio: Some fixes that seem to avoid an assertion in libpulse.
- Make sure the hotplug thread has hit its main loop before letting
  DetectDevices continue.
- Don't unref the context subscription operation until it completes
  (or we are shutting down).

I'm not sure which change fixed the problem, but at least one of them
appears to have done so.

Reference Issue #7971.
2023-07-12 23:29:39 -04:00
Ozkan Sezer
776a5e0d25 pulseaudio: eliminate <pulse/simple.h> include. 2023-07-13 01:51:10 +03:00
Ozkan Sezer
376c6a9dd1 apply commit 3aba9d4473 to autotools, too. 2023-07-13 01:51:02 +03:00
Ryan C. Gordon
3aba9d4473
pulseaudio: We should be using libpulse, not libpulse-simple.
This probably worked by a quirk of the dynamic loader...?

(cherry picked from commit 6aef14fb2d40bc39580d198423930741104c8d94)
2023-07-12 16:43:05 -04:00
Ryan C. Gordon
832b524180
pulseaudio: don't wait on pa_context_subscribe in hotplug thread.
This risks blocking the thread if disaster ensues, and we can wait in the
thread's main loop for subscription as well anywhere else.

Reference Issue #7971.

(cherry picked from commit 956b18f50cc3794f253b025cca6e5e00c445fd67)
2023-07-12 16:05:09 -04:00
Ozkan Sezer
29d461b628 need pulseaudio >=0.9.15. call pa_threaded_mainloop_set_name only if available. 2023-07-12 21:39:41 +03:00
Sam Lantinga
e8b6edd5a0 RAWINPUT_RegisterNotifications() should return int, for consistency
(cherry picked from commit 1903d7b1bf6c73ef23e4d6934c9fec5246dd0b2e)
2023-07-11 10:52:57 -07:00
Sam Lantinga
34c5bde355 Improved RAWINPUT <-> XInput/WGI device correlation
If there is only one controller slot available, assume that's the one matching new RAWINPUt devices. This will be right most of the time, and uncorrelation will fix any bad guesses.

(cherry picked from commit 41882a1acb6054dc7a56fd5ff7f0a279ba1144c0)
2023-07-11 10:46:37 -07:00
Sam Lantinga
9117b2e300 Fixed crash if RAWINPUT is not initialized
We shouldn't be doing any of this work in that case

(cherry picked from commit dfc5e6964eca0a0813768518d08cf1c80136e896)
2023-07-11 10:46:37 -07:00
Sam Lantinga
6bf5f5a221 Don't send k_ePS4FeatureReportIdCapabilities to Sony PS4 controllers
This report is for third party controllers only, and might be causing issues with fake PS4 controllers.

Reference https://github.com/libsdl-org/SDL/issues/7960

(cherry picked from commit 092a4b780ca464de71b89ffa5dc655ce256ce350)
2023-07-10 09:48:43 -07:00
Sam Lantinga
92fd2938e7 Minor cleanup 2023-07-10 09:42:12 -07:00
Andre Barata
9cd7cbe134 Added support for absolute mice with evdev 2023-07-10 09:37:45 -07:00
Christopher Wellons
8231278817
Unaligned stacks on i686-w64-mingw32, may lead to crashes (#7607)
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2023-07-10 03:05:32 +03:00
Ozkan Sezer
0ad822eb70 SDL_RWFromMem, SDL_RWFromConstMem: reject negative size parameters. 2023-07-10 00:14:35 +03:00
Sam Lantinga
156c7badf5 Re-added mappings for older Xbox One controllers on Linux
The xpad kernel driver doesn't know about these controllers and ends up using BTN_C and BTN_Z and the automatic mapping doesn't work correctly.

It turns out VID 0x045e and PID 0x02e0 is used by the 8BitDo SN30 Pro when connecting via Bluetooth in XInput mode.

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

(cherry picked from commit 80e1c75e1c6d330318478c1549a97aedb09e58bc)
2023-07-09 09:50:46 -07:00
Joshua Barnett
547c8c288b Add kernel32 to SDL_EXTRA_LIBS required for cross-compilation to Win32 native
Linking error experienced while compiling with the following toolchain
due to lack of kernel32.lib

d35e5f8dde/cmake/platforms/WinMsvc.cmake (L317-L321)
2023-07-09 14:02:32 +02:00
Sam Lantinga
4b1dd54a56 Fixed mapping BTN_TR2 to right trigger
(cherry picked from commit ea60da5b94ed8ec69aad69ca46e81567ab99ed2a)
2023-07-08 18:18:48 -07:00
Alex Maese
acdde129bb X11: Use XFixes to detect clipboard updates
Currently, SDL_CLIPBOARDUPDATE events are only sent when an SDL window
has its selection cleared.  This change sends the event anytime the
XFixesSelectionNotify event is raised, and when the selection is either
the clipboard or the primary selection.
2023-07-08 13:17:40 -07:00
Sam Lantinga
f8a0135edf Added WGI gamepad added/removed listeners for RAWINPUT
This fixes WGI correlation on startup when the WGI gamepad list isn't populated yet

(cherry picked from commit f047e178b610c6888212c3096c10eb3f64f31a15)
2023-07-08 10:40:12 -07:00
Sam Lantinga
1f7bc08884 Don't tickle Bluetooth PS4 controllers in simple mode with an effects packet
That will put the PS4 controller into enhanced mode, which breaks DirectInput games

(cherry picked from commit efed24850af2994802c28f7a257ea17c9ec97d0a)
2023-07-08 10:30:31 -07:00
Sam Lantinga
de849d5e6f Lazily initialize the WGI gamepad support
Initializing "Windows.Gaming.Input.Gamepad" will put Bluetooth PS4 controllers into enhanced report mode, which breaks any game using DirectInput. Let's wait to do this until absolutely necessary.

(cherry picked from commit 785f57eb9102206e74ac7f9b363a37cbf037cf9d)
2023-07-08 10:30:14 -07:00
Sam Lantinga
a6228e7aaf Added the hint SDL_HINT_JOYSTICK_WGI to control whether to use Windows.Gaming.Input for controllers 2023-07-08 09:34:58 -07:00
Sam Lantinga
e16a83d393 Prefer using XInput for rumble over WGI, as it allows rumble in the background 2023-07-07 09:47:49 -07:00
Sam Lantinga
a0a3957eb6 Continue running XInput detection while RAWINPUT is active
This allows us to re-enable XInput correlation for RAWINPUT devices without reintroducing the controller shutdown bug for controllers using the wireless adapter in https://github.com/libsdl-org/SDL/issues/3468.

Fixes https://github.com/libsdl-org/SDL/issues/7940
2023-07-07 09:47:48 -07:00
Takase
b90343e512 video(wayland): use both --icon and --icon-name for Zenity (#7897)
video(wayland): use both --icon and --icon-name for Zenity

Many distros ship an older version of Zenity that supports GTK3, while some distros ship newer version of Zenity which uses libadwaita.

This command tries to use --icon and fall back to --icon-name when it fails.
2023-07-06 17:56:51 -07:00
Sam Clegg
042243471f emscripten: Add JS library dependencies using EM_JS_DEPS macro
See https://github.com/emscripten-core/emscripten/pull/19780
2023-07-06 18:15:49 -04:00
Sam Lantinga
3054c0dc50 Fixed %p formatting when there is following text
(cherry picked from commit f4bd17deeeca6957d92979cf07fa436c249a9eda)
2023-07-06 08:37:27 -07:00
Sam Lantinga
52d63ba26c Do a full UCS4 zero termination on iconv converted strings
We don't necessarily know the size of the output characters, so do a full 32-bit zero termination on the output string.

This fixes garbage at the end of Windows clipboard text

(cherry picked from commit ecbbac7c7292300cf998a2ff04db3c721203b0b7)
2023-07-05 22:25:49 -07:00
Sam Lantinga
bad5431a14 Fixed wayland clipboard not always updating in response to Ctrl-C
(cherry picked from commit cc254d885d66d4c3499f63864b8d403e1e97f325)
2023-07-05 22:18:16 -07:00
Sam Lantinga
1ab452fc57 Fixed printf formatting for "%p" and added a unit test to check it
(cherry picked from commit c63aa9545eb800390176fd2fd86036da81f91100)
2023-07-05 22:17:15 -07:00