From 59c5ac0cb57769ed635372e17deddafcbe3a4589 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Wed, 10 Sep 2014 19:16:01 +0200 Subject: [PATCH] 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 --- src/backends/meta-backend.c | 6 ++++++ src/backends/native/meta-backend-native.c | 1 + 2 files changed, 7 insertions(+) diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index 424208180..a3b74ed18 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -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 diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c index cb9d3a789..6e2741bae 100644 --- a/src/backends/native/meta-backend-native.c +++ b/src/backends/native/meta-backend-native.c @@ -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