[mutter/gnome-3-34] wayland: preserve `xkb_state` on VT switch
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-34] wayland: preserve `xkb_state` on VT switch
- Date: Thu, 30 Apr 2020 15:09:03 +0000 (UTC)
commit 129d1347044731d0d43c3f77b7a901a54e6cc271
Author: Olivier Fourdan <ofourdan redhat com>
Date: Wed Apr 8 11:43:23 2020 +0200
wayland: preserve `xkb_state` on VT switch
On VT switch, the devices are removed, which means for Wayland disabling
the keyboard.
When the keyboard is disabled, the associated `xkb_state` is freed and
recreated whenever the keyboard is re-enabled when switching back to the
compositor VT.
That means the `xkb_state` for Wayland is lost whereas the same for
clutter is kept, which causes to a discrepancy with locked modifiers on
VT switch.
To avoid that issue, preserve the XKB info only to dispose it when the
keyboard is eventually finalized.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/344
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1185
(cherry picked from commit 5b30a52bbda87f903d7008d09d1d70cd750cac4a)
src/wayland/meta-wayland-keyboard.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index d74ef0dfa..1cde419c7 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -599,7 +599,6 @@ meta_wayland_keyboard_disable (MetaWaylandKeyboard *keyboard)
meta_wayland_keyboard_end_grab (keyboard);
meta_wayland_keyboard_set_focus (keyboard, NULL);
- meta_wayland_xkb_info_destroy (&keyboard->xkb_info);
wl_list_remove (&keyboard->resource_list);
wl_list_init (&keyboard->resource_list);
@@ -913,7 +912,18 @@ meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard)
keyboard_handle_focus_surface_destroy;
}
+static void
+meta_wayland_keyboard_finalize (GObject *object)
+{
+ MetaWaylandKeyboard *keyboard = META_WAYLAND_KEYBOARD (object);
+
+ meta_wayland_xkb_info_destroy (&keyboard->xkb_info);
+}
+
static void
meta_wayland_keyboard_class_init (MetaWaylandKeyboardClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = meta_wayland_keyboard_finalize;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]