Commit graph

11247 commits

Author SHA1 Message Date
Sylvain 17515f4aef Backport simplify flags PR #7220 2023-02-09 17:19:46 -08:00
Sam Lantinga f71178a16f Fixed MFI controller being opened while HIDAPI controller was being opened
This was the callstack:
    frame #3: 0x00000001004e1930 libSDL3.1.0.0.dylib`IOS_AddJoystickDevice(controller=0x0000600003b0c000, accelerometer=SDL_FALSE) at SDL_mfijoystick.m:528:14
    frame #4: 0x00000001004e1a54 libSDL3.1.0.0.dylib`__IOS_JoystickInit_block_invoke(.block_descriptor=0x0000000100547760, note=@"GCControllerDidConnectNotification") at SDL_mfijoystick.m:673:45
    frame #5: 0x000000018601e578 CoreFoundation`__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 128
    frame #6: 0x00000001860bc074 CoreFoundation`___CFXRegistrationPost_block_invoke + 88
    frame #7: 0x00000001860bbfbc CoreFoundation`_CFXRegistrationPost + 440
    frame #8: 0x0000000185fefbac CoreFoundation`_CFXNotificationPost + 708
    frame #9: 0x0000000186edc72c Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 88
    frame #10: 0x000000019b054a18 GameController`__60-[_GCControllerManagerAppClient _onqueue_publishController:]_block_invoke + 156
    frame #11: 0x0000000185dc19dc libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #12: 0x0000000185dc3504 libdispatch.dylib`_dispatch_client_callout + 20
    frame #13: 0x0000000185dd1d1c libdispatch.dylib`_dispatch_main_queue_drain + 928
    frame #14: 0x0000000185dd196c libdispatch.dylib`_dispatch_main_queue_callback_4CF + 44
    frame #15: 0x000000018606ad6c CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
    frame #16: 0x00000001860287ec CoreFoundation`__CFRunLoopRun + 2036
    frame #17: 0x00000001860278a4 CoreFoundation`CFRunLoopRunSpecific + 612
    frame #18: 0x00000001003b1194 libSDL3.1.0.0.dylib`process_pending_events at hid.c:509:9
    frame #19: 0x00000001003aebe8 libSDL3.1.0.0.dylib`PLATFORM_hid_open_path(path="USB_054c_05c4_0x11a104290", bExclusive=0) at hid.c:823:2
    frame #20: 0x00000001003b051c libSDL3.1.0.0.dylib`SDL_hid_open_path_REAL(path="USB_054c_05c4_0x11a104290", bExclusive=0) at SDL_hidapi.c:1419:19
    frame #21: 0x00000001004dabdc libSDL3.1.0.0.dylib`HIDAPI_SetupDeviceDriver(device=0x0000600003518000, removed=0x000000016fdfee3c) at SDL_hidapijoystick.c:399:19
    frame #22: 0x00000001004da890 libSDL3.1.0.0.dylib`HIDAPI_AddDevice(info=0x000060000212c2d0, num_children=0, children=0x0000000000000000) at SDL_hidapijoystick.c:843:5
    frame #23: 0x00000001004d9148 libSDL3.1.0.0.dylib`HIDAPI_UpdateDeviceList at SDL_hidapijoystick.c:1000:21
    frame #24: 0x00000001004d9940 libSDL3.1.0.0.dylib`HIDAPI_JoystickDetect at SDL_hidapijoystick.c:1205:13
    frame #25: 0x00000001003bc6d8 libSDL3.1.0.0.dylib`SDL_UpdateJoysticks_REAL at SDL_joystick.c:1703:9
    frame #26: 0x00000001003a13a8 libSDL3.1.0.0.dylib`SDL_PumpEventsInternal(push_sentinel=SDL_FALSE) at SDL_events.c:855:9
    frame #27: 0x00000001003a1340 libSDL3.1.0.0.dylib`SDL_PumpEvents_REAL at SDL_events.c:879:5
    frame #28: 0x000000010038b380 libSDL3.1.0.0.dylib`SDL_PumpEvents at SDL_dynapi_procs.h:572:1
    frame #29: 0x0000000100004524 testgamepad`loop + 40
    frame #30: 0x00000001000063d8 testgamepad`main + 2140

(cherry picked from commit a9650d440a862b86dc5722a402b06bf2bbbec527)
2023-02-09 12:07:42 -08:00
Sam Lantinga d77eb8a8d5 Make sure we synchronously re-enable USB reporting mode for Switch controllers (thanks @SortaCore!)
Fixes https://github.com/libsdl-org/SDL/issues/3450

(cherry picked from commit b7c6fec10a152e47f8fa18350134188b75e9df0b)
2023-02-08 14:31:05 -08:00
Sam Lantinga 3fb9118cb6 Note the Google Stadia controller doesn't support rumble over Bluetooth
(cherry picked from commit 50575ed2233b9924198e10c9a261c10323d9089e)
2023-02-08 14:31:05 -08:00
Sam Lantinga 71fb4e3d76 Fixed mis-detecting the share button on the Xbox controller over NDIS
(cherry picked from commit 00e02de77b615d5faf94af709760fd0f2e749a39)
2023-02-08 14:31:05 -08:00
Sam Lantinga 2518e32de8 Dynamically update the serial number if it isn't available at first
This happens for Xbox One controllers using newer firmware connected over NDIS

(cherry picked from commit d1c72bb0bc54fba41ba89930a3ed98f8767be724)
2023-02-08 14:31:01 -08:00
Sam Lantinga e8938fc66a Enable paddles on the Xbox Elite controller when connected over USB
(cherry picked from commit c4db0725e4cf5eb6ec5239e6f03346958e88b9cf)
2023-02-08 14:27:05 -08:00
Ozkan Sezer fde6323662 fix build after the Logitech ChillStream patch. 2023-02-07 01:11:02 +03:00
Sam Lantinga 7154605982 Added support for the Logitech ChillStream
(cherry picked from commit 6f7edaf8920c504ebd3e797bd04ec1d2e46c4aa9)
2023-02-06 13:28:44 -08:00
Ozkan Sezer c68cfcdb2d make sure to not enable SDL_PASSED_BEGINTHREAD_ENDTHREAD for WinRT 2023-02-07 00:21:56 +03:00
Ozkan Sezer 7bf3e28dc6 windows/SDL_systhread.c: remove some dead code. 2023-02-07 00:21:40 +03:00
Sam Lantinga 3fa5a2f794 Fixed warning running a command queue without any vertex operations
(cherry picked from commit f8b41919dac0fb95553f910d02faafc6d7205692)
2023-02-06 11:25:35 -08:00
Sean Ridenour af5efadd9f Setting the same mouse cursor twice is a no-op
This fixes extremely poor event polling performance on MacOS when using
Dear ImGui, which sets the mouse cursor every frame.
2023-02-05 14:14:54 -05:00
Sam Lantinga 5b5a72e33c Sorted controller list
(cherry picked from commit 1c03ddefc320ec9969d5f81c2c3cb988d94a8b4c)
2023-02-05 08:44:46 -08:00
Antonis Geralis 58fa43e7c3 Added Elecom 8button gamepad
(cherry picked from commit 52cd9fcbb074771804f443e7a9b2e9436485fe83)
2023-02-05 08:44:46 -08:00
Leonardo Brondani Schenkel 4266cf8504 Add Linux mapping for 8BitDo Pro 2 Wired Controller for Xbox
Without these mappings, this controller "kinda" works out of the box:
- `SDL_GameControllerMapping()` works because it will notice "Xbox" in
  the name and use the default XInput mappings
- `SDL_GameControllerMappingForGUID()` will not find any mapping

lsusb:
```
ID 2dc8:2000 8BitDo 8BitDo Pro 2 Wired Controller for Xbox
```

In Linux this controller is supported by two drivers:
- `xpad` (built-in to the kernel), exposes the controller name from the
  USB descriptor and the GUID starts with 03 (0x03 = BUS_USB)
- `xone` (https://github.com/medusalix/xone), exposes a virtual
  controller which is always named "Microsoft X-Box One pad" and the
  GUID starts with 06 (0x06 = BUS_VIRTUAL)

This commit adds the 2 GUIDs from both drivers so mappings will always
be found and the real controller name will always be reported.
2023-02-05 08:44:37 -08:00
Ozkan Sezer 4f7f72c257 replaced line comments in public header. 2023-02-04 10:02:10 +03:00
Anonymous Maarten c5035d8ffd include: add comment documenting the change(s) to SDL_opengl_glext.h 2023-02-04 02:44:37 +01:00
Alynne 92779a5bd8 Adds Stadia BT mapping
(cherry picked from commit 4dea13e02fbfd2ac9eeb0a5cbb35cf5d1d53f549)
2023-02-03 15:02:47 -08:00
Anonymous Maarten 0dc4373aad opengl: make SDL_opengl_glext.h's include compatible with macos
- Mesa defines __gl_glext_h_
- Apple defines __glext_h_
2023-02-03 21:05:54 +01:00
Ozkan Sezer 06b305d232 dynapi: cast GetProcAddress() result to void* 2023-02-03 17:40:40 +03:00
Sam Lantinga c4a493de97 Don't accept official mappings for controllers that aren't unique
For example, the DragonRise Inc. Generic USB Joystick
See https://github.com/gabomdq/SDL_GameControllerDB/issues/202 for details

(cherry picked from commit 673bc5764942e3f645f1ff7d64f3d6a2059e3cdb)
2023-02-02 08:41:57 -08:00
Sam Lantinga 4a87abc966 Fixed sort_controllers.py and resorted game controller database
(cherry picked from commit 917607c335a87edcb3870b8504247609bea3c04d)
2023-02-02 08:41:36 -08:00
Sam Lantinga 2290d71338 Added gamepad mappings for the Xin-Mo Dual Arcade Fightstick
(cherry picked from commit d29e1f363239b45aedf5f81683fbb6cf52029bc2)
2023-02-01 23:07:47 -08:00
Sasha Szpakowski 17ecb11ed6 macOS: fix initial Metal drawable size in certain multi-display setups
(cherry picked from commit baca26d72701655157c2a1ab678c2d5af0830d53)
2023-02-01 22:42:12 -08:00
Anonymous Maarten 8800d40442 cmake: assume autotools static libraries with lib prefix and .a suffix 2023-02-01 19:05:44 +01:00
Ryan C. Gordon 7ac43cfb6b
Note that version.rc is public domain.
This avoids potential concerns that customizing would qualify a build
of SDL as an "altered source version" under the zlib license.
2023-01-29 11:46:22 -05:00
Matt Durgavich dfc56cfc0e Fix For issue #6948 (#6991)
MessageBoxes attached to a window in macOS should use modal APIs and not
use a poll/sleep pattern on the main thread. Sleeping the main thread
makes the NSWindow message loop sluggish and interferes with external
applications that need to send messages to that window, such as
VoiceOver.
2023-01-28 15:49:51 -08:00
Ryan C. Gordon c83428475d
wikiheaders: Link to the SDL3 wiki in the preamble.
Reference Issue #6568.
2023-01-26 14:45:12 -05:00
Ryan C. Gordon d5680c5d20
wikiheaders: Allow markdown in the wikipreamble string.
Reference Issue #6568.

(cherry picked from commit a089b2ea19404f6dacd083327e13cae888b58993)
2023-01-26 10:23:21 -05:00
Ryan C. Gordon 1069c8931d
wikiheaders: Add a \threadsafety tag to document threading details.
Reference Issue #7140.

(cherry picked from commit 01cba48d18f9002e5aae66d4b009f5f0195dc8d7)
2023-01-26 10:23:08 -05:00
Jiří Malák 507fc462db
SDL_atomic.h: Update SDL_CPUPauseInstruction for Watcom. (#7157)
Appropriate CPU directive can be used in #pragma aux so that it is not
necessary to hardcode instruction bytes.
2023-01-26 17:00:02 +03:00
Anonymous Maarten d9d84c8d73 ci: test PVR_PSP2 (gles/gl) and gib (gles) 2023-01-25 00:22:50 +01:00
Anonymous Maarten e927e5d440 vita: add missing static libraries for using gles with pib 2023-01-25 00:22:50 +01:00
Anonymous Maarten 33ec2a5e94 vita: fix reformatting error in SDL_vtagl_pvr.c 2023-01-25 00:22:50 +01:00
Anonymous Maarten a8a5bd3d6b cmake: allow disabling OpenGL support when building with GLES using PSP2-PVR 2023-01-25 00:22:50 +01:00
ds-sloth 038ccd764a Support MIN/MAX blend on opengles2 2023-01-23 06:09:58 -08:00
Anonymous Maarten c0445c23bf vita: PVR needs to link to sceIme_stub library 2023-01-23 05:08:59 +01:00
ds-sloth 9670f233cc Support MIN/MAX blend on OpenGL + ES 2023-01-22 13:48:13 -08:00
Frank Praznik ea179abdb7 wayland: Enforce or override libdecor minimum window size
libdecor plugins can change the min/max window size values internally to enforce a minimum window size, and errors and crashes can result if the window size is below the internal limit.

On versions of libdecor >= 0.1.1, the minimum width and height can be queried and the minimum required window size will be enforced. The application requested window size is still respected, however, the actual window may be slightly larger than the drawable area to accommodate the required libdecor minimum size.

On version 0.1.0 of libdecor, which lacks the function to retrieve the minimum size, the internal limits are overridden before committing a frame, so that the internal limits always match the window size as a workaround, even if the window is technically smaller than the plugin would normally allow.

(cherry picked from commit 423a82cd4b65cf72668551093bfdf58d49bce9ce)
2023-01-22 08:20:34 -08:00
raphasamp eabd88ed28 Update SDL_vitagles_pvr.c
This was broken unintentionally during #6545.(cherry picked from commit 9211c0b639ad32865efa4980d07fc24f3f4a1577)
2023-01-22 17:32:50 +03:00
PARTY MAN X a44b646105 Blacklist Konami Amusement Controllers From HIDAPI.
Fixes issue #7118 by adding all Konami Amusement controllers to the
blacklist.  Additionally, the blacklist is changed to exclude a whole
vendor when the PID 0x0000 is used.
2023-01-21 22:03:57 -08:00
Ozkan Sezer 880ac537a5 typo fix to config.sub,
from https://lists.gnu.org/archive/html/config-patches/2023-01/msg00001.html
2023-01-21 10:15:02 +03:00
Guldoman 7b8f0ba8b7 wayland: Set APPLICATION scancode name to Menu
This mimics the behavior of the other platforms.

(cherry picked from commit 6c06f5ce93c55fe0f5779d5aeb68bec1bd935455)
2023-01-19 15:06:18 -08:00
Ozkan Sezer 73a68c6ea5 regenerated configure script. 2023-01-18 21:56:10 +03:00
Frank Praznik 44dc90dcc8 autotools: Add check for libdecor get min/max functions 2023-01-18 10:32:43 -08:00
Fabian Greffrath 8efa1f8fc6 add support for libsamplerate's "linear" resampling mode
Fixes #6998
2023-01-16 16:31:34 -05:00
Sylvain 5d1e6b28d9
SDL_test_harness: fix memory leak when generated seed 2023-01-16 10:43:28 +01:00
Sylvain c638b4a682
SDL_CreateAudioStream: check for invalid parameters 2023-01-16 09:26:05 +01:00
Anonymous Maarten 01a4cf8a10 ci: don't require EXTRA_ prefix on input environment variables 2023-01-15 17:29:37 +01:00