Commit Graph

11075 Commits

Author SHA1 Message Date
hwsmm
915ef28753 Fix mouse button not changing in pen mouse emulation 2024-06-28 11:27:35 -04:00
Ryan C. Gordon
87439c0008 x11: Fix build when X_HAVE_UTF8_STRING is not defined.
Fixes #10094.

(cherry picked from commit 3e4bb5acd0)
2024-06-27 22:14:31 -07:00
Ryan C. Gordon
d8e68aea9d atomic: Solaris needs the _nv variant of atomic_or_uint.
(This means "new value" and returns the atomically updated value. Before, we
were returning a value from a void function.)

(cherry picked from commit 498cbffd89)
2024-06-27 23:50:31 -04:00
Sam Lantinga
b7748c1513 Prevent duplicate calls to start/stop text input 2024-06-27 17:43:03 -07:00
Sam Lantinga
3609b15920 Fixed showing the selected clause in the Japanese IME 2024-06-27 17:43:03 -07:00
Ryan C. Gordon
a9cfcf6bde stdinc: Drastically improve SDL_StepUTF8() and make it a public API.
Fixes #10105.
2024-06-27 17:36:09 -04:00
Ryan C. Gordon
982feb7a65 vulkan: SDL_Vulkan_CreateSurface now returns the usual int (0=ok, -1=error).
Fixes #10091.
2024-06-27 15:25:10 -04:00
Ozkan Sezer
a4f962fd46 SDL_x11shape.c: fix build if SDL_VIDEO_DRIVER_X11_XSHAPE isn't defined
Fixes :  https://github.com/libsdl-org/SDL/issues/10128.
2024-06-27 05:47:50 +03:00
Frank Praznik
800c35a2c1 dialog: Don't potentially call SDL_free() on an uninitialized value 2024-06-26 21:56:40 -04:00
Frank Praznik
596651f13a dialog: Decodes percent encoded URI paths returned by the xdg file portal 2024-06-26 21:31:35 -04:00
Frank Praznik
71200e94a8 core: Factor out common URI decode functions from Wayland and X11 2024-06-26 21:31:35 -04:00
Sam Lantinga
0ae4fd0ec9 Make sure we don't try to use the XInput DLL after it's unloaded
Steam ran into a crash SDL_XINPUT_JoystickDetect() with XINPUTGETCAPABILITIES being NULL. I'm not sure how that happened, and there may still be a race condition if this is a multi-threaded issue, but at least this is more correct.
2024-06-26 15:44:03 -07:00
Francisco Javier Trujillo Mata
d86ea0622d Add slash to cwd call 2024-06-26 13:31:59 -07:00
Sam Lantinga
8949de3978 Fixed building with older libdrm headers 2024-06-26 12:18:43 -07:00
Sam Lantinga
56e85064ff Fixed audio recording latency after a hitch
We want to return any data as soon as it's available, if we get a hitch and always wait, we'll never catch up.
2024-06-26 12:06:03 -07:00
Sam Lantinga
80e64ef921 Windows IME cleanup
* Don't need to initialize values already zeroed
* Added debug message logging
* Don't send duplicate SDL_EVENT_TEXT_EDITING events with empty text
* Send the length of selected text in the SDL_EVENT_TEXT_EDITING event
* Fixed potential crashes when out of memory
2024-06-26 08:26:52 -07:00
hwsmm
dc8b06fb5a Check if SDL_GetKeyboardFocus is null in X11/Wayland events 2024-06-26 08:11:54 -07:00
Edoardo Lolletti
64acde86de stdcpp threads, simplify SDL_GetCurrentThreadID implementation
Removed the workaround that handrolled a thread id using a thread_local variable alongside static mutexes
2024-06-26 09:06:27 -04:00
Cecill Etheredge
e9a93246ef fix: Use drmModeAddFB2WithModifiers instead of drmModeAddFB to allow using GBM modifiers.
This fixes corrupt framebuffers on platforms that require the use of modifiers.

(cherry picked from commit 620e875335)
(cherry picked from commit 6589287ed6)
2024-06-25 14:21:36 -07:00
Sam Lantinga
b37b94453c Fixed multi-window test programs not quitting when windows are closed 2024-06-25 10:17:52 -07:00
Aleksander
596c0af0f3 Camera: Bugfix: ChooseBestCameraSpec doesn't set camera colorspace 2024-06-25 07:03:22 -07:00
Sam Lantinga
0804598b5d Added a font glyph for missing characters 2024-06-24 20:32:03 -07:00
Sam Lantinga
def7a43a2e SDL_HINT_IME_SHOW_UI defaults to SDL_TRUE
This hint is currently only used on Windows, and this matches the behavior of other platforms.
2024-06-24 20:32:03 -07:00
Sam Lantinga
018ca39c45 Don't move the cursor to the end of the selected candidate
We might have legitimately moved the cursor to the beginning.

Fixes https://github.com/libsdl-org/SDL/issues/9761
2024-06-24 20:32:03 -07:00
Sam Lantinga
8328fdfe0d Don't use raw keyboard input when text input is active
This lets IME processing consume key events that shouldn't be passed on to the application
2024-06-24 20:32:03 -07:00
Frank Praznik
f79d0adfc9 x11: Avoid excessive keymap reconstruction
KeymapNotify events happen on focus events, as well as when the keymap group changes. Query the current group and don't rebuild the keymap if it hasn't changed.

Note that some IME changes, such as activating intelligent Japanese or Chinese input methods on Gnome, will only trigger IBus activation, and won't send a keymap or group update as they use the existing layout.
2024-06-24 16:39:20 -04:00
Sam Lantinga
0ff5c05486 Added SDL_GetWindows() 2024-06-24 12:22:12 -07:00
Sam Lantinga
2f5b20fcb5 Updated based on feedback from @JKaniarz 2024-06-24 11:49:15 -07:00
Sam Lantinga
a938e2b979 Replaced test framework random code with SDL random functions 2024-06-24 11:49:15 -07:00
Sam Lantinga
96f2f23240 Simplified SDL random function names and added thread-safe versions 2024-06-24 11:49:15 -07:00
Sam Lantinga
89cdadf7c3 Added SDL_isinf(), SDL_isinff(), SDL_isnan(), and SDL_isnanf() 2024-06-24 11:49:15 -07:00
Edoardo Lolletti
20dbe90771 Fix std::thread memory leak
In the stdcpp thread implementation, the allocated std::thread objects were never deleted after joining/detaching
2024-06-24 14:20:10 -04:00
Sam Lantinga
76631a0978 The text input state has been changed to be window-specific.
SDL_StartTextInput(), SDL_StopTextInput(), SDL_TextInputActive(), SDL_ClearComposition(), and SDL_SetTextInputRect() all now take a window parameter.

This change also fixes IME candidate positioning when SDL_SetTextInputRect() is called before SDL_StartTextInput(), as is recommended in the documentation.
2024-06-24 11:20:08 -07:00
Frank Praznik
a4ceb3a31c Revert "x11: Avoid excess keymap reconstruction"
Switching between layouts with the same group number (e.g. US to Japanese) were incorrectly filtered out with this change, as it doesn't trigger a MappingNotify event.

This reverts commit 3d42412650.
2024-06-23 22:21:09 -04:00
Frank Praznik
3d42412650 x11: Avoid excess keymap reconstruction
KeymapNotify events happen on focus events, as well as when the key group changes. Query the current group and don't rebuild the keymap if it hasn't changed.
2024-06-23 17:52:21 -04:00
Frank Praznik
974bbea20b x11: Add keymap support
XkbKeycodeToKeySym is replaced with XkbLookupKeySym, which can take the modifier states. The associated cmake check has been renamed for consistency.

Only the XKB path is currently handled. The deprecated XKeycodeToKeysym path is TODO.
2024-06-23 15:40:55 -04:00
Frank Praznik
c874a78ffb wayland: Add keymap support 2024-06-23 15:40:55 -04:00
Sam Lantinga
ab3c8552c2 Clean up renderers at shutdown
Fixes https://github.com/libsdl-org/SDL/issues/10082
2024-06-23 00:41:19 -07:00
expikr
3b504c4a89 Add SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL (#10085) 2024-06-23 00:09:59 -07:00
Frank Praznik
0280d8249a keyboard: Fix typo 2024-06-22 15:56:50 -04:00
Sam Lantinga
90034b16dc The keycode in key events is affected by modifiers by default.
This behavior can be customized with SDL_HINT_KEYCODE_OPTIONS.
2024-06-22 00:19:06 -07:00
Sam Lantinga
0dd579d40d Removed SDL_Keysym 2024-06-21 22:06:08 -07:00
Sam Lantinga
679e4471ed Added the ability to query the keymap for keycodes based on modifier state 2024-06-21 22:06:08 -07:00
Sam Lantinga
ef9bd8b609 Add the raw platform specific key code to SDL_Keysym
This allows applications to handle keys that SDL doesn't recognize, in a platform dependent way.

Fixes https://github.com/libsdl-org/SDL/issues/6390
2024-06-21 22:06:08 -07:00
Sam Lantinga
9d816c72ef Updated SDL3 scancode list
This adds more app editing and audio control keys and removes keys that launch applications

Work in progress on https://github.com/libsdl-org/SDL/issues/6390
2024-06-21 22:06:08 -07:00
Sam Lantinga
00ab4a8eba Added missing Windows scancodes
Based on the scancode list at https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_code_values, which is correct for all other scancodes
2024-06-21 22:06:08 -07:00
Sam Lantinga
306c4164bc Added SDL_AllocateEventString() 2024-06-21 22:06:08 -07:00
Anonymous Maarten
cf267e4985 Fix -Wunused-variable warning in src/video/x11/SDL_x11events.c 2024-06-21 17:39:37 +02:00
Sam Lantinga
6e53a36414 Fixed Y + right shoulder button combination on third party Switch controllers 2024-06-20 14:39:04 -07:00
Frank Praznik
2f276a2eea video: Expose HDR metadata per-window
Moves the HDR properties from the display to be per-window, and adds the frog_color protocol to enable HDR under Wayland.
2024-06-20 15:55:07 -04:00