backend/x11: Notify whenever the layout group changes

Will be used to trigger keyboard binding rebuild.

https://bugzilla.gnome.org/show_bug.cgi?id=786408
This commit is contained in:
Jonas Ådahl 2017-08-17 17:03:28 +08:00
parent 517488ef67
commit a81d4aed7a

View File

@ -283,8 +283,6 @@ handle_host_xevent (MetaBackend *backend,
if (xkb_ev->any.device == META_VIRTUAL_CORE_KEYBOARD_ID)
{
int layout_group;
switch (xkb_ev->any.xkb_type)
{
case XkbNewKeyboardNotify:
@ -292,8 +290,20 @@ handle_host_xevent (MetaBackend *backend,
keymap_changed (backend);
break;
case XkbStateNotify:
if (xkb_ev->state.changed & XkbGroupLockMask)
{
int layout_group;
gboolean layout_group_changed;
layout_group = xkb_ev->state.locked_group;
layout_group_changed =
(int) priv->keymap_layout_group != layout_group;
priv->keymap_layout_group = layout_group;
if (layout_group_changed)
meta_backend_notify_keymap_layout_group_changed (backend,
layout_group);
}
break;
default:
break;