Ryan C. Gordon
1fd66cc890
Revert "cocoa: Backed out CVDisplayLink code for macOS vsync."
...
This reverts commit 04b50f6c6b
.
It turns out OpenGL vsync has broken again in macOS 12, so
we're reintroducing our CVDisplayLink code to deal with it,
again.
Reference Issue #4918 .
2022-11-16 11:34:25 -05:00
Ryan C. Gordon
9d67686a5b
haptic: Deal with deprecated macOS symbol.
2022-11-16 10:08:40 -05:00
Ryan C. Gordon
6801d676c0
Revert "pulseaudio: Only use PA_STREAM_ADJUST_LATENCY if buffer isn't super small."
...
This reverts commit d8b1ef42ae
.
This turned out to be unnecessary (it was a problem on the user's system,
not an SDL bug).
Reference Issue #6121 .
2022-11-16 09:53:37 -05:00
Frank Praznik
903301c6aa
wayland: Always use integer scaling for cursors.
...
Cursors don't get fractionally scaled, so always scale system cursor sizes to the next whole integer.
2022-11-16 06:15:17 -08:00
Ryan C. Gordon
d8b1ef42ae
pulseaudio: Only use PA_STREAM_ADJUST_LATENCY if buffer isn't super small.
...
Fixes #6121 .
2022-11-15 22:44:31 -05:00
Sam Lantinga
02ab7f3745
Fixed release build using clang on Windows
2022-11-15 12:57:07 -08:00
Sam Lantinga
98f93d0aa1
Fixed building without xkbcommon support
2022-11-15 11:39:06 -08:00
Sam Lantinga
615901dbfe
Removed unnecessary header
...
The xkbcommon-keysyms.h header isn't available on some older systems,
and we don't actually need it for this code.
2022-11-15 11:19:08 -08:00
Frank Praznik
c855184765
wayland: Handle virtual keyboards that don't fit the X mapping
...
SDL is built around the concept of keyboards having a fixed layout with scancodes that correspond to physical keys no matter what linguistic layout is used. Virtual keyboards don't have this concept and can present an arbitrary layout of keys with arbitrary scancodes and names, which don't fit the SDL model. When one of these keyboards is encountered, it requires special handling: use the keysym of the pressed keys to derive their ANSI keyboard scancode equivalents for control keys and ASCII characters. All other characters are passed through as text events only.
2022-11-15 11:00:39 -08:00
Frank Praznik
d1858eb124
events: Add a helper function to get the default keycode for a scancode
...
Add a helper function to get the keycode for a scancode from the default lookup table. Unlike SDL_GetKeyFromScancode(), this is not affected by the set keymap.
2022-11-15 11:00:39 -08:00
Frank Praznik
0e446c54bd
events: Factor out the xkb keysym to scancode conversion from the X11 driver
2022-11-15 11:00:39 -08:00
Ryan C. Gordon
44d7b8b91d
egl: Check for a NULL pointer in SDL_EGL_GetProcAddress.
...
This happens on kmsdrm if you try to GetProcAddress before creating
a window.
Fixes #5399 .
2022-11-15 13:59:24 -05:00
Ethan Lee
f3cc99fb93
x11: Minor style fixes for recent OSK changes
2022-11-15 13:56:44 -05:00
Sam Lantinga
70656b133c
Don't recreate the window when creating a Metal renderer on an OpenGL window.
...
It turns out that we can safely create a Metal view on an existing window, and that avoids issues with the window being recreated with the wrong orientation in iOS 16.
Fixes https://github.com/libsdl-org/SDL/issues/6289
2022-11-15 10:21:07 -08:00
Pierre Wendling
80ff20f6fe
N3DS: Set keyboard focus to newly created windows.
...
This fixes polling issues with Joystick subsystem where
`SDL_PrivateJoystickShouldIgnoreEvent` would always return true, thus
ignoring all inputs.
2022-11-14 21:24:10 -08:00
Pierre Wendling
491d0bcc3c
N3DS: Refactor N3DS_FileOpen.
2022-11-14 21:24:10 -08:00
Pierre Wendling
de5fa89b50
N3DS: Prepend PrefPath with `sdmc:`.
2022-11-14 21:24:10 -08:00
Pierre Wendling
7d536d5240
N3DS: Put `SDL_Log.txt` in the proper directory.
...
The homebrew "user" directory should be `/3ds/`.
To avoid ambiguity, `sdmc:` is specified.
2022-11-14 21:24:10 -08:00
Pierre Wendling
bf4f9aaa63
N3DS: Use designated initialiser for drivers.
...
Just a sanity check that the functions are actually mapped correctly.
2022-11-14 21:24:10 -08:00
Sam Lantinga
a40b7cde10
Workaround for views being in portrait instead of landscape mode on iOS 16
...
Fixes https://github.com/libsdl-org/SDL/issues/6289
2022-11-14 13:03:52 -08:00
pionere
b886f4c6c9
events: eliminate redundant code in SDL_SendEditingText
2022-11-14 09:00:45 -08:00
pionere
dad8df3ed1
video: check graphics flags the same way in SDL_RecreateWindow as in SDL_CreateWindow
...
- single check to validate the graphics flags
- check it before tearing down the window
2022-11-14 07:53:41 -08:00
Frank Praznik
eef4d3c86a
wayland: Clamp wl_seat version on older versions of libwayland
...
Clamp the wl_seat max version to 5 if being built against a version of libwayland below 1.21.0, or containers that bundle newer versions of SDL with older versions of libwayland can break if the compositor advertises support for a protocol version above 5.
2022-11-13 17:48:14 -06:00
Sam Lantinga
674989261d
Fixed warning
...
Fixes https://github.com/libsdl-org/SDL/issues/5842
2022-11-13 11:09:39 -08:00
Ethan Lee
c4b9f62164
x11: Add support for the Steam Deck on-screen keyboard
2022-11-13 11:02:27 -08:00
pionere
5f2a1231dd
video: check graphics flags the same way as the type flags
2022-11-13 08:31:50 -08:00
pionere
22354b4142
video: simplify window-type check in SDL_CreateWindow
2022-11-12 07:18:04 -08:00
Ryan C. Gordon
85aa9b8b6f
wasapi: Favor the system resampler again, for now.
...
Reference Issue #5538 .
2022-11-11 13:48:11 -05:00
Sam Lantinga
9f8b68a278
Fixed building without linux/input.h
...
https://github.com/libsdl-org/SDL/issues/6169
2022-11-11 10:25:52 -08:00
Sam Lantinga
b7e65a81f1
Fixed incorrect WGI controller state when the application loses focus
...
Recenter the controller elements when WGI stops reporting valid state
Fixes https://github.com/libsdl-org/SDL/issues/5261
2022-11-11 08:58:27 -08:00
Michael Fitzmayer
875e9b35d7
N-Gage: additional cleanup
2022-11-11 05:04:28 -08:00
Michael Fitzmayer
afbafc2aef
Remove redundant dependency to bitdraw.h, minor cleanup
2022-11-11 05:04:28 -08:00
pionere
d09edcbcac
video: sync Metal_CreateView with GL_CreateContext and Vulkan_CreateSurface
...
no need to check if _this->Metal_CreateView, since it is already checked in Re(create)Window
2022-11-11 04:58:40 -08:00
pionere
b71d927429
video: add NOT_AN_OPENGL_WINDOW define (similar to NOT_A_VULKAN_WINDOW)
2022-11-11 04:58:40 -08:00
pionere
36c6ed4b6f
video: add SDL_DllNotSupported
...
- add SDL_DllNotSupported and use it to sync the behavior of SDL_GL_LoadLibrary with SDL_Vulkan_LoadLibrary
2022-11-11 02:53:30 -08:00
Sam Lantinga
0dfc829a6b
Added simple BLE Steam Controller support on all platforms
...
This is still disabled by default via the hint SDL_HINT_JOYSTICK_HIDAPI_STEAM
2022-11-10 19:17:04 -08:00
Sam Lantinga
f430ef5ddc
Don't change the window position when creating it on iOS, it is already placed on the correct display
2022-11-10 17:27:48 -08:00
Sam Lantinga
7c05ea0a0e
Added mappings for the GameSir T3 and T4 Pro controllers
2022-11-10 13:35:59 -08:00
Sam Lantinga
404cb27677
Added macOS mappings for the Nintendo Switch Pro Controller over Bluetooth
2022-11-10 13:28:03 -08:00
pionere
29cafa9c94
add SDL_ContextNotSupported and validate flags in SDL_RecreateWindow similar to SDL_CreateWindow
2022-11-10 06:56:24 -08:00
Ryan C. Gordon
1008cc8e5f
video: Add some braces to match SDL coding style.
2022-11-09 12:55:27 -05:00
pionere
ac3349faaf
solve FIXMEs in SDL_video.c
2022-11-09 12:54:07 -05:00
pionere
e5c599f8c6
fix SOLARIS_ATOMICS
...
- use 'sizeless' int types (int uses 32-bit even if _LP64 is set)
2022-11-09 12:45:14 -05:00
pionere
b095df7f5c
simplify MSC_ATOMICS
...
- use _Interlocked(Compare)ExchangePointer in case of _M_IX86 as well
- improve assertions:
1. add assertions to SDL_AtomicAdd/SDL_AtomicSet and SDL_AtomicCAS
2. use sizeof(a->value) instead of sizeof(int)
2022-11-08 10:32:31 -08:00
meyraud705
3dc88da022
Fix Dualshock 4 rumble stopping too early
...
Dualshock 4 controller only rumbles for 5 seconds maximum. Resend
rumble command every 2 seconds to make long rumble work.
2022-11-08 10:30:11 -08:00
Sam Lantinga
6432f45a1c
Don't treat the Nintendo IMU as a separate game controller on Linux
2022-11-08 10:27:21 -08:00
Sam Lantinga
2e3b4f3fd7
Don't send rumble to the Amazon Luna controller on macOS
...
Sending rumble to the Amazon Luna controller on macOS gets there, but IOHIDDeviceSetReport() blocks for a long time and eventually fails.
This appears to be a bug in the macOS Bluetooth stack, ref rdar://99265496
2022-11-08 07:50:51 -08:00
Sam Lantinga
02bc359b64
Shorten "Bensussen Deutsch & Associates,Inc.(BDA)" to "BDA" for controller names
2022-11-07 19:31:18 -08:00
Ryan C. Gordon
b0dc6709b9
coreaudio: Don't use deprecated kAudioObjectPropertyElementMaster symbol.
...
Fixes #6449 .
2022-11-07 14:26:48 -05:00
pionere
e873d60981
fix handling of SDL_EventQ.active
...
- SDL_EventQ.active is a bool variable -> do not use SDL_AtomicGet/Set, it does not help in any way
- protect SDL_EventQ.active with SDL_EventQ.lock
- set SDL_EventQ.active to FALSE by default
2022-11-07 09:12:37 -08:00
pionere
eb670742f5
better SDL_AtomicGet(Ptr) implementation
2022-11-07 09:09:37 -08:00
Hubert Maier
5dc93451d2
JANITORIAL : Correct some more spelling mistakes ( #6489 )
2022-11-06 11:49:37 -08:00
Sam Lantinga
c2675d74c5
Revert "cocoa: Discard the IME Candidate Window immediately when Escape is pressed"
...
This reverts commit 0d76e2a8a1
, as it introduced other issues:
https://github.com/libsdl-org/SDL/pull/6486#issuecomment-1304684865
2022-11-06 10:52:20 -08:00
Sam Lantinga
f2ce7c5fb2
Added the G29 as a PlayStation controller
2022-11-06 08:23:08 -08:00
Sam Lantinga
9d1dbd2ad8
Added note about trigger rumble availability across third-party Xbox One controllers
2022-11-06 01:16:52 -08:00
Sam Lantinga
e7a56323ab
Make sure we wait after sending the rumble packet when initializing the PowerA Xbox One Mini Wired Controller
2022-11-06 01:43:05 -07:00
Sam Lantinga
6875e62af3
Make sure we don't send Xbox controllers rumble so quickly that it overwhelms the firmware
...
Fixes https://github.com/libsdl-org/SDL/issues/6435
2022-11-06 01:15:20 -07:00
Sam Lantinga
38af459dd9
Fixed potential clobbering of packets of different types using SDL_HIDAPI_SendRumble()
2022-11-06 01:15:19 -07:00
Sam Lantinga
e45cb5b1e2
Fixed initializing the PowerA Xbox One Mini Wired Controller
2022-11-06 01:15:18 -07:00
Edward Li
0d76e2a8a1
cocoa: Discard the IME Candidate Window immediately when Escape is pressed
2022-11-05 17:03:10 -07:00
Sam Lantinga
15a9890919
Added SDL_HINT_HIDAPI_IGNORE_DEVICES to specify devices that should be ignored in SDL_hid_enumerate()
2022-11-05 16:44:52 -07:00
Sam Lantinga
297ecb706d
Added SDL_strcasestr() for a case insensitive version of SDL_strstr()
2022-11-05 15:58:30 -07:00
Sam Lantinga
a4626dea8d
Fixed initializing the PDP Xbox One and Victrix Gambit controllers
2022-11-05 14:24:41 -07:00
Sam Lantinga
7e11b09b3b
The PowerA Xbox One Mini Wired Controller works with the HIDAPI driver now
2022-11-05 13:50:37 -07:00
Sam Lantinga
a2d66b6a91
SDL_GameControllerMapping() should return the string for the actual mapping that was used when opening a gamecontroller, rather than do a GUID match again
...
Also don't match against the zero guid if that happens to be in the mapping list for some reason
2022-11-05 13:12:10 -07:00
Stefan Sperling
f3bf543e2a
recognize game controllers connected via raphnet technologies WUSBMote v2.2
...
This is a USB adapter for controllers shipped with Nintendo's NES-mini and
SNES-mini consoles.
Tested with both NES and SNES controllers, buttons map as expected on both.
2022-11-05 10:35:07 -07:00
Sam Lantinga
24cdebe464
Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED to control the brightness of the Xbox button LED on the Xbox One controller
2022-11-05 10:34:08 -07:00
Ryan C. Gordon
78f97108f9
audio: Avoid accumulation errors in resampler.
...
Fixes #6391 .
2022-11-05 10:39:35 -04:00
David Edmundson
689218ebf5
Fix wayland reconnection paths
...
Most of this code is disabled out for now.
- For mouse cursors we have a wl_surface for both system and custom
cursors which needs recreating.
- The other patch is about nullification after deletions
2022-11-04 11:13:30 -04:00
Sam Lantinga
33a68f575f
Added Linux mappings for the Logitech G29 in PS3 and PS4 modes
2022-11-03 16:02:58 -07:00
Sam Lantinga
c70e675900
Wait a bit for devices to initialize before trying to enumerate and open them.
...
This works around udev event nodes arriving before hidraw nodes and the controller being opened twice - once using the Linux driver and once by the HIDAPI driver.
This also fixes a kernel panic on Steam Link hardware due to trying to open the hidraw device node too early.
A delay of 10 ms seems to be a good value, tested on Steam Link hardware.
2022-11-03 12:37:54 -07:00
Guldoman
084fa4c3fa
cocoa: Reset IME when sending composed text
...
This will send an empty `TEXTEDITING` event that is used to signal the
end of the composition.
2022-11-03 10:41:53 -07:00
Guldoman
70a41f9bc2
wayland: Read `window` data only if `window` is valid
2022-11-01 05:14:05 -07:00
Sam Lantinga
b75d318776
Sometimes the HID open doesn't succeed immediately after being notified about the device
...
Tested on Steam Link hardware with the Nintendo Switch Pro controller, which will occasionally take 2 attempts to open.
2022-10-31 13:33:53 -07:00
Jasper Hugunin
27ee8c8e14
Fix mismatch between Init and Quit
...
Init says that audio implies events (line 195), Quit was missing the implication.
2022-10-31 11:22:40 -07:00
Frank Praznik
33a430056f
wayland: Don't modify the mouse capture flag in relative mode
...
If relative mouse mode is explicitly enabled, don't modify the capture flag on button events or the window might report having lost mouse focus if a button is pressed while moving the cursor.
2022-10-31 10:13:58 -07:00
Hubert Maier
678ef7977f
SDL_KMSDRMOPENGLES.H: Correct spelling mistakes
...
begining -> beginning
beggining -> beginning
2022-10-30 11:24:42 -04:00
Hubert Maier
8b9c82e140
SDL_RENDER_PSP.C: Correct spelling mistakes
...
wether -> whether
2022-10-30 11:24:42 -04:00
Hubert Maier
3369b0163f
SDL_PS2_MAIN.C: Correct spelling mistake
...
untill -> until
2022-10-30 11:24:42 -04:00
Hubert Maier
d7a46a16e9
SDL_SYSLOADSO.c: Correct spelling mistake
...
publically -> publicly
2022-10-30 11:24:42 -04:00
Hubert Maier
6a881302ad
SDL_IBUS.H: Correct spelling mistake
...
recieve -> receive
2022-10-30 11:24:42 -04:00
Hubert Maier
61f3662c95
SDL_QSA_AUDIO.C: Correct spelling mistake
...
occured -> occurred
2022-10-30 11:24:42 -04:00
Ethan Lee
571ff1a3a9
wayland: Prepare cursor implementation for reconnect support
...
Co-authored-by: David Edmundson <kde@davidedmundson.co.uk>
2022-10-30 00:19:09 -04:00
Ethan Lee
9c8b1fd8b6
wayland: Cleanup work to aid reconnect support
...
Co-authored-by: David Edmundson <kde@davidedmundson.co.uk>
2022-10-29 22:41:42 -04:00
Sam Lantinga
f6b1e028ab
Allow vendor matching for hid_enumerate() on all backends
2022-10-29 10:43:11 -07:00
Sam Lantinga
4556074e18
Re-set the maximize state if we were maximized while fullscreen
2022-10-29 09:35:07 -07:00
Sam Lantinga
ab06a307dc
Don't report windows being maximized when fullscreen on X11
...
This is a functional state for some window managers (tested using stock Ubuntu 22.04.1), and removing that state, e.g. using SDL_RestoreWindow(), results in a window centered and floating, and not visually covering the rest of the desktop.
2022-10-29 09:21:17 -07:00
Ryan C. Gordon
b9e1d1b4de
events: Rename SDL_SendKeyboardKeyComplete to SDL_SendKeyboardKeyAndKeycode.+
2022-10-28 16:19:00 -04:00
Ryan C. Gordon
9221548114
emscripten: Make an attempt at correct keyboard scancode/keycodes.
...
This uses a newer browser API to get physical scancodes, but still
uses the (deprecated) event field that we were already using for
scancodes, but for keycodes instead now, which appears to be more
accurate.
Since keyboard layout isn't (generally) available to web apps, this
adds an internal interface to send key events with both scancode
and keycode to SDL's internals, instead of sending just scancodes and
expecting SDL to use its own keymap to generate keycodes.
Future work in this area would be to use the keyboard layout APIs
on browsers that support them, which would allow us to use SDL's
usual keymap code and not rely on a deprecated browser API, but
until we get there, this patch gives significantly more correct
results than we would have before.
Fixes #2098 .
2022-10-28 16:19:00 -04:00
Francisco Javier Trujillo Mata
a8f019b1f0
Using ST and removing warnings
2022-10-28 11:42:44 -07:00
Francisco Javier Trujillo Mata
f2ebedae92
adding texture function
2022-10-28 11:42:44 -07:00
Francisco Javier Trujillo Mata
5de01eb0aa
Make render to use new functions
2022-10-28 11:42:44 -07:00
Sam Lantinga
f500c14766
Fixed DirectFB build
2022-10-28 08:39:02 -07:00
Ryan C. Gordon
9e8d2f3948
video: Don't use texture framebuffer on Windows Subsystem for Linux.
...
Reference Issue #6333 .
2022-10-27 13:54:53 -04:00
Frank Praznik
4223e6ac7a
wayland: Early-out sooner when requesting fullscreen on a popup
...
Exit the fullscreen sequence sooner if it is requested that a popup window be fullscreen.
The surface commit formerly in this path is irrelevant and can be removed as previous changes made it so that SetFullscreen() is no longer called from anywhere except Wayland_SetWindowFullscreen().
2022-10-26 22:19:59 -04:00
Ryan C. Gordon
41d38c0f64
shape: More robust handling of failure cases in CreateShaper.
2022-10-26 13:57:49 -04:00
Ryan C. Gordon
c8d20f96ba
shape: Free platform-specific shaped window data.
...
Fixes #2128 .
2022-10-26 13:57:49 -04:00
Frank Praznik
30c2dac787
wayland: Remove duplicate #include statement
2022-10-25 17:03:25 -07:00
Sam Lantinga
25d0473aad
Removed Razer Onza Tournament Edition mapping
...
The controller can use either hat or buttons for the D-Pad, depending on what Linux driver is in use. The automatic mapping in LINUX_JoystickGetGamepadMapping() will do the right thing based on the exposed capability bits.
I'm sure this is the case for other controllers as well, so we might be removing more mappings over time.
2022-10-25 16:14:26 -07:00
Sam Lantinga
e837debc25
Bindings should have a trailing comma, so the CRC can be appended
2022-10-25 16:13:50 -07:00