[mutter] wayland-keyboard: Handle keymap-changed signal
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland-keyboard: Handle keymap-changed signal
- Date: Thu, 11 Sep 2014 17:08:38 +0000 (UTC)
commit 53092424e69a2a93f8637827fb08e9d4f1abe0b4
Author: Rui Matos <tiagomatos gmail com>
Date: Wed Sep 10 19:13:46 2014 +0200
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 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index 1306bd3..1980c6f 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -207,6 +207,15 @@ err_keymap_str:
}
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)
{
MetaWaylandKeyboard *keyboard = wl_container_of (listener, keyboard, focus_surface_listener);
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]