SDL/src/test
Frank Praznik 113475acbd wayland: Add multi-seat support
Wayland environments can expose more than one seat for multiple collections of input devices, which can include multiple, simultaneously active, desktop pointers and keyboards with independent layouts. The Wayland input backend previously presumed that only one seat could exist, which caused broken behavior if the compositor exposed more than one, which is possible on wlroots based compositors such as Sway. This introduces support for handling multiple seats, including proper handling of dynamically added and removed seats and capabilities at run time.

The SDL Wayland input system was accreted over time, and the assumption that only one seat will ever exist resulted in state and related objects not always being tied to their most appropriate owner in a multi-seat scenario, so refactoring was required to manage several bits of state per-seat, instead of per-window or globally.

As Wayland keyboards can have per-seat layouts, fast keymap switching is required when multiplexing input from multiple seats to the global SDL keyboard device. A parameter was added to the keymap creation function to specify if the keymap lifetime should be externally managed to facilitate keymap reuse, and some layout info was moved from the global keyboard state to the keymap state to avoid unnecessarily redetermining it whenever a reused keymap is bound. This reduces the overhead of switching keymaps to setting a single pointer.

Multiple seats also means that multiple windows can have keyboard and/or mouse focus at the same time on some compositors, but this is not currently a well-handled case in SDL, and will require more work to support, if necessary.
2025-04-12 13:39:17 -04:00
..
SDL_test_assert.c Updated copyright for 2025 2025-01-01 07:45:52 -08:00
SDL_test_common.c wayland: Add multi-seat support 2025-04-12 13:39:17 -04:00
SDL_test_compare.c Updated copyright for 2025 2025-01-01 07:45:52 -08:00
SDL_test_crc32.c Updated copyright for 2025 2025-01-01 07:45:52 -08:00
SDL_test_font.c Fixed potentially overlapping memcpy() to use memmove() 2025-01-14 14:31:20 -08:00
SDL_test_fuzzer.c Remove redundant casts 2025-02-21 10:09:10 -08:00
SDL_test_harness.c SDL_test: fix "'function': different 'const' qualifiers" warning in SDL_test_harness 2025-02-19 19:06:48 +01:00
SDL_test_log.c Updated copyright for 2025 2025-01-01 07:45:52 -08:00
SDL_test_md5.c Updated copyright for 2025 2025-01-01 07:45:52 -08:00
SDL_test_memory.c Fixed memory leak in memory leak tracking 2025-03-08 09:18:25 -08:00