[mutter] wayland: Unset keyboard/pointer focus when releasing the data for these devices



commit 1677a068ce666fcb057421fb6d771ebcdb41b46c
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jul 22 00:30:21 2014 +0200

    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(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index 4ee7fcd..c7dc961 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 ce22e7c..a603335 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);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]