X11: Recompile keymaps on XkbNewKeyboardNotify events

Hopefully fixes #2726
This commit is contained in:
Kovid Goyal 2020-06-05 22:11:15 +05:30
parent 24ca919f33
commit c7c14f184c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 2 deletions

View File

@ -34,6 +34,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Wayland: Fix mouse cursor rendering on HiDPI screens (:pull:`2709`) - Wayland: Fix mouse cursor rendering on HiDPI screens (:pull:`2709`)
- X11: Recompile keymaps on XkbNewKeyboardNotify events (:iss:`2726`)
0.17.4 [2020-05-09] 0.17.4 [2020-05-09]
-------------------- --------------------

7
glfw/x11_window.c vendored
View File

@ -1177,8 +1177,11 @@ static void processEvent(XEvent *event)
{ {
XkbEvent *kb_event = (XkbEvent*)event; XkbEvent *kb_event = (XkbEvent*)event;
switch(kb_event->any.xkb_type) { switch(kb_event->any.xkb_type) {
case XkbNewKeyboardNotify: case XkbNewKeyboardNotify: {
if(!glfw_xkb_update_x11_keyboard_id(&_glfw.x11.xkb)) return; int32_t old_id = _glfw.x11.xkb.keyboard_device_id;
if (!glfw_xkb_update_x11_keyboard_id(&_glfw.x11.xkb)) return;
if (old_id != _glfw.x11.xkb.keyboard_device_id) keymap_dirty = true;
}
/* fallthrough */ /* fallthrough */
case XkbMapNotify: case XkbMapNotify:
{ {