wayland: Don't recreated keymaps on layout change

The GDK model for keymaps expects the keymap object to stay
around and emit a ::keys-changed signal. So, do that. This
should make layout changes work, but it remains untested since
weston does not support layout changes at runtime.

At the same time, plug a memory leak where GdkWaylandKeymap
forgot to free its xkb objects in finalize.
https://bugzilla.gnome.org/show_bug.cgi?id=696339
This commit is contained in:
Matthias Clasen
2013-03-23 18:02:28 -04:00
parent 0f59ff4550
commit 9182eacadf
3 changed files with 29 additions and 18 deletions

View File

@ -777,10 +777,11 @@ keyboard_handle_keymap (void *data,
uint32_t size)
{
GdkWaylandDeviceData *device = data;
if (device->keymap)
g_object_unref (device->keymap);
device->keymap = _gdk_wayland_keymap_new_from_fd (format, fd, size);
_gdk_wayland_keymap_update_from_fd (device->keymap, format, fd, size);
g_signal_emit_by_name (device->keymap, "keys-changed");
g_signal_emit_by_name (device->keymap, "state-changed");
}
static void