Skip to content

Commit 98298ea

Browse files
authored
Revert 23aba56 (ignore XkbNewKeyboardNotify) - Filter by (#782)
req_minor code. Originally removed because keymap_changed() was being called in ordinary use - with multiple devices involved (a volume knob on a keyboard is considered a separate device), a freeze could occur when switching between them. Unfortunately, the updating of xkb options also triggers this event, and ignoring it was causing Muffin keybinding handling of iso-next- group (grp) xkb option changes to be ignored, including at the beginning of a session when the xkb options are first applied. Re-add this event case, but check the event's req_minor value to determine whether or not to call keymap_changed() - hotplug and set_keymap() events have the same code, and should be handled. ref: https://gitlab.gnome.org/GNOME/mutter/-/issues/398 linuxmint/cinnamon#13361
1 parent d235e8e commit 98298ea

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/backends/x11/meta-backend-x11.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,18 @@ handle_host_xevent (MetaBackend *backend,
395395
{
396396
switch (xkb_ev->any.xkb_type)
397397
{
398+
case XkbNewKeyboardNotify:
399+
XkbNewKeyboardNotifyEvent *xkb_nkb_ev = (XkbNewKeyboardNotifyEvent *) xkb_ev;
400+
// req_minor == 23 is X_kbGetKeyboardByName, triggered by:
401+
// - set_keymap() calls
402+
// - true keyboard hotplug
403+
// req_minor == 9 is X_kbGetDeviceInfo, triggered by device switches
404+
// (e.g., alternating between keyboard and volume knob) - ignore these
405+
if (xkb_nkb_ev->req_minor == 23)
406+
{
407+
keymap_changed (backend);
408+
}
409+
break;
398410
case XkbMapNotify:
399411
keymap_changed (backend);
400412
break;

0 commit comments

Comments
 (0)