backends: Add a keymap-layout-group-changed signal

We'll need this in the wayland frontend to send a modifiers event to
clients.

Note that on X11 this isn't needed because key events include the
group index encoded in modifier state. If we ever want to make the
wayland frontend work with the X11 backend we'll handle it then.

https://bugzilla.gnome.org/show_bug.cgi?id=736433
This commit is contained in:
Rui Matos 2014-09-10 19:16:01 +02:00
parent 53092424e6
commit 59c5ac0cb5
2 changed files with 7 additions and 0 deletions

View File

@ -254,6 +254,12 @@ meta_backend_class_init (MetaBackendClass *klass)
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
g_signal_new ("keymap-layout-group-changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_UINT);
}
static void

View File

@ -229,6 +229,7 @@ meta_backend_native_lock_layout_group (MetaBackend *backend,
{
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
clutter_evdev_set_keyboard_layout_index (manager, idx);
g_signal_emit_by_name (backend, "keymap-layout-group-changed", idx, 0);
}
static void