From 1677a068ce666fcb057421fb6d771ebcdb41b46c Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 22 Jul 2014 00:30:21 +0200 Subject: [PATCH] wayland: Unset keyboard/pointer focus when releasing the data for these devices Otherwise the focus_surface_listener list element becomes stale, and then mangled if the devices' data is initialized again, and the memory memset(). https://bugzilla.gnome.org/show_bug.cgi?id=733563 --- src/wayland/meta-wayland-keyboard.c | 1 + src/wayland/meta-wayland-pointer.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index 4ee7fcd90..c7dc96115 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -301,6 +301,7 @@ meta_wayland_xkb_info_destroy (MetaWaylandXkbInfo *xkb_info) void meta_wayland_keyboard_release (MetaWaylandKeyboard *keyboard) { + meta_wayland_keyboard_set_focus (keyboard, NULL); meta_wayland_xkb_info_destroy (&keyboard->xkb_info); xkb_context_unref (keyboard->xkb_context); diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index ce22e7c48..a603335d4 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -214,6 +214,7 @@ meta_wayland_pointer_init (MetaWaylandPointer *pointer, void meta_wayland_pointer_release (MetaWaylandPointer *pointer) { + meta_wayland_pointer_set_focus (pointer, NULL); set_cursor_surface (pointer, NULL); }