From 4d1125e3e8a4ee466e4466c9f512978a9237e276 Mon Sep 17 00:00:00 2001 From: Attila Fidan Date: Wed, 29 Jan 2025 07:51:13 +0000 Subject: [PATCH] WaylandBackend: Don't assert on non-xkb-v1 keymaps Long story short, there are some edge cases where sway may send no_keymap to clients when a virtual keyboard is created on the seat, in specific circumstances. It will later send the xkb keymap before any key events are sent. Other clients simply ignore non-xkb-v1 keymaps (or the lack of a keymap), they don't assert. So gamescope should do the same. --- src/Backends/WaylandBackend.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Backends/WaylandBackend.cpp b/src/Backends/WaylandBackend.cpp index e924ac865..72de941ba 100644 --- a/src/Backends/WaylandBackend.cpp +++ b/src/Backends/WaylandBackend.cpp @@ -2904,7 +2904,8 @@ namespace gamescope // Ideally we'd use this to influence our keymap to clients, eg. x server. defer( close( nFd ) ); - assert( uFormat == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 ); + if ( uFormat != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 ) + return; char *pMap = (char *)mmap( nullptr, uSize, PROT_READ, MAP_PRIVATE, nFd, 0 ); if ( !pMap || pMap == MAP_FAILED )