From 53092424e69a2a93f8637827fb08e9d4f1abe0b4 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Wed, 10 Sep 2014 19:13:46 +0200 Subject: [PATCH] wayland-keyboard: Handle keymap-changed signal We need to inform wayland clients of new keymaps. https://bugzilla.gnome.org/show_bug.cgi?id=736433 --- src/wayland/meta-wayland-keyboard.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index 1306bd3c0..1980c6f7c 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -206,6 +206,15 @@ err_keymap_str: return; } +static void +on_keymap_changed (MetaBackend *backend, + gpointer data) +{ + MetaWaylandKeyboard *keyboard = data; + + meta_wayland_keyboard_take_keymap (keyboard, meta_backend_get_keymap (backend)); +} + static void keyboard_handle_focus_surface_destroy (struct wl_listener *listener, void *data) { @@ -337,6 +346,8 @@ void meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard, struct wl_display *display) { + MetaBackend *backend = meta_get_backend (); + memset (keyboard, 0, sizeof *keyboard); keyboard->display = display; @@ -354,8 +365,9 @@ meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard, g_signal_connect (keyboard->settings, "changed", G_CALLBACK (settings_changed), keyboard); - meta_wayland_keyboard_take_keymap (keyboard, - meta_backend_get_keymap (meta_get_backend ())); + g_signal_connect (backend, "keymap-changed", + G_CALLBACK (on_keymap_changed), keyboard); + meta_wayland_keyboard_take_keymap (keyboard, meta_backend_get_keymap (backend)); } static void