xcb_xkb_get_names reply always returns "us" layout until XCB_XKB_NEW_KEYBOARD_NOTIFY detects first keypress
Submitted by Florian Hubold
Assigned to Xorg Project Team
It was suggested via https://github.com/sddm/sddm/issues/202 to report this here as it seems to be an XCB bug. To reproduce, start e.g. sddm with a non-english keyboard layout (selected via localectl) and it will always show "us" layout until the first key has been pressed, then the correct layout will be shown and also used.
More detailed description via davispuh: https://github.com/sddm/sddm/issues/202#issuecomment-133628462
This is Xcb bug (even with latest libxcb from git master branch), because in XcbKeyboardBackend::initLayouts
cookie = xcb_xkb_get_names(m_conn, XCB_XKB_ID_USE_CORE_KBD, XCB_XKB_NAME_DETAIL_GROUP_NAMES | XCB_XKB_NAME_DETAIL_SYMBOLS); reply = xcb_xkb_get_names_reply(m_conn, cookie, nullptr);
it always returns "us" layout on startup, but as soon as any key is pressed then > XCB_XKB_NEW_KEYBOARD_NOTIFY event will be issued and then it will return correct > layout.
Version: 7.7 (2012.06)