Commit Graph

10934 Commits

Author SHA1 Message Date
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
Anonymous Maarten
e6c4db8160 The SDL2::SDL2 target in SDL2.framework needs to see the SDL2 include folder
SDL.h includes other files through SDL2/SDL_xxx.h
2022-11-15 19:22:47 +01: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
a71ad40ac3
CMake: Add option to use Ccache. 2022-11-15 19:04:22 +01:00
SDL Wiki Bot
5e61f245ab Sync SDL wiki -> header 2022-11-15 05:25:16 +00: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
dcfa127fd4 N3DS: Document the SDL_GetBasePath behaviour. 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
Pierre Wendling
d080e3bf3a Silence -Wmaybe-uninitialized warnings in tests. 2022-11-14 21:23:08 -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
Sam Lantinga
9f784b1887 The iOS and tvOS demos link SDL statically, not as a framework 2022-11-14 10:59:23 -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
Sam Lantinga
1b0277da61 Move SDL_mslibc.c into the source file list 2022-11-13 11:09:38 -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
Ozkan Sezer
dd44cacbd6 remove duplicated SDL_hidapi_steam.c additions to watcom makefiles. 2022-11-11 12:51:30 +03: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