Commit Graph

11174 Commits

Author SHA1 Message Date
Sam Lantinga
4c9a79dddb Removed duplicated conditional
(cherry picked from commit 1a15d506a69d5d73a53728c569ef84a69db51833)
2023-02-20 18:26:07 -08:00
Sam Lantinga
7c4f5e1def Fixed rumble caps for the Nintendo Joy-Con controllers
(cherry picked from commit 02cea5fca107991774792c431efc96319ef2d060)
2023-02-20 18:25:57 -08:00
Sam Lantinga
abe8dbbf1c Added support for the Razer Wolverine V2 controllers
(cherry picked from commit 4994654d4f2d5c96a0faa972ebbb6c653f939d56)
2023-02-20 18:25:38 -08:00
Sam Lantinga
0efb31ef32 cocoa/gles: do not unload EGL when context is destroyed
(cherry picked from commit e8091b89830c3b9bb19eff76463a6e2525f05fa5)
2023-02-20 10:43:15 -08:00
Marc-André Lureau
eb22fbc894 windows/gles: do not unload EGL when context is destroyed
It's legitimate to have multiple contexts.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
(cherry picked from commit 93861e1de00a76080fa6ed756a6bd9c764b3ec07)
2023-02-20 10:42:18 -08:00
Marc-André Lureau
479bc2d5ed windows/gles: correct indentation
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
(cherry picked from commit 654965a6286ccb3ef861310d0cff578788641091)
2023-02-20 10:41:45 -08:00
Ryan C. Gordon
e6e654e25c
include: Fix symbols in public headers that start with an underscore.
Fixes #7352.
2023-02-20 11:38:26 -05:00
Sam Lantinga
7b06007266 Fixed typo (thanks @Iniquitatis!)
(cherry picked from commit ced02319a6bd001c1c2ce85a48887efe3a7b79d8)
2023-02-19 09:58:07 -08:00
Lauri Kasanen
7d55ccb8b0 Fix GetGlobalMouseState when xi2 is not available at runtime
(cherry picked from commit 0123d6311d5c0059d617324426ef7eef8d577d9b)
2023-02-19 09:56:39 -08:00
Ozkan Sezer
da6bce4f76 SDL_x11dyn.h: include XInput2.h also for Xfixes
Fixes https://github.com/libsdl-org/SDL/issues/7343
2023-02-11 23:51:28 +03:00
Le Philousophe
74e8a6451b Fix window size in X11 when window manager refuses to resize
(cherry picked from commit a67ae8eed57f4545c739e6eb3a4b8c1169d3afbc)
2023-02-18 12:33:18 -08:00
Sam Lantinga
f741adc86c Added other names for the DragonRise Inc. Wired Wheel (thanks @felimwhiteley!)
(cherry picked from commit eede2066fbcc342e96592fbbbfe94b2420feb524)
2023-02-17 11:30:49 -08:00
Anonymous Maarten
817141c162 ci: install pkg-config on Macos runner
(cherry picked from commit 86f0c694653eb1f1e91213c7faf3080a96c6375b)
2023-02-17 01:05:00 +03:00
Sam Lantinga
e86f494317 Hold the joystick lock while opening the HID device on non-Android platforms
On Windows the main thread can be enumerating DirectInput devices while the Windows.Gaming.Input thread is calling back with a new controller available, and in this case HIDAPI_IsDevicePresent() returned false since the controller initialization hadn't completed yet, creating a duplicate controller.

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

(cherry picked from commit ece8a7bb8e2dae9cb53115980cea9ef1213a0160)
2023-02-16 09:53:33 -08:00
Sylvain
d948e6c3c5
Fix potential de-referencing null pointer in SDL_EVDEV_kbd_keycode() 2023-02-16 08:23:22 +01:00
Sam Lantinga
e7376b7b74 Fixed Steam Runtime sandbox detection
Fixes hotplug issues on Steam Deck for Proton and native games

(cherry picked from commit bcd97b36d23d08226e98a995eafd3d6aa35401b4)
2023-02-15 13:54:50 -08:00
Sam Lantinga
69b2baec5c Map the Android MENU button back to the SDL MENU key
Thanks to @AntTheAlchemist for the investigation!

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

(cherry picked from commit beb6a2afdc74a00f07ec230297c2675920a7bf79)
2023-02-14 18:04:30 -08:00
Sam Lantinga
2c6995778e Fixed handling simple mode PS4 reports
Fixes https://github.com/libsdl-org/SDL/issues/7270

(cherry picked from commit 5925cd4ef377a2211fd057ef6fa9f41141999cb7)
2023-02-14 17:53:37 -08:00
Ozkan Sezer
22df572979 look for clock_gettime() in libc first, then in librt if not found. 2023-02-13 22:28:02 +03:00
Ozkan Sezer
634705851d cmake: really fix detection of pthread_setname_np() on Apple platforms. 2023-02-13 11:56:10 +03:00
Ozkan Sezer
1194f52a5c cmake: fix detection of pthread_setname_np() on Apple platforms. 2023-02-13 11:55:40 +03:00
Sylvain
45e5f0f10b
Fixed bug #7302 - Memory 'leak' in SDL_SetMouseSystemScale() 2023-02-13 09:43:13 +01:00
Knightly
a23d1af0ac Guard against _USE_MATH_DEFINES redefinition 2023-02-12 20:47:00 +03:00
Francisco Javier Trujillo Mata
2b66ef0df4 Fixed audio 2023-02-11 13:22:47 -08:00
Sam Lantinga
7285f0d441 Sorted controller list
(cherry picked from commit 68e2f230662a0b3f2ce7c0085f781f1652901af3)
2023-02-10 17:18:32 -08:00
Alfredo Escobar
ca3468cb55 Add Hori Pokken Tournament DX Pro Pad
(cherry picked from commit 76552e4780a57f24ec1cd77fb942b7cabe1219d8)
2023-02-10 17:17:00 -08:00
Bruce Mitchener
7d2012af87 emscripten: Update deprecated calls to EM_ASM*.
`EM_ASM_` and `EM_ASM_INT_V` are calls that have been deprecated
for a long time.

Since the return value isn't used for the call to `EM_ASM_`, it
can be replaced with `EM_ASM`.

`EM_ASM_INT_V` is now (for the last few years) `EM_ASM_INT`.

(cherry picked from commit a8e89f2567b9069c919f9b21996e0a46cd4bb679)
2023-02-10 07:11:31 -08:00
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