diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index 5b98c4f6f..e07b6f29c 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -217,28 +217,22 @@ err_keymap_str: return; } -static void -release_focus (MetaWaylandKeyboard *keyboard) -{ - wl_list_remove (&keyboard->focus_surface_listener.link); - wl_list_remove (&keyboard->focus_resource_listener.link); - - keyboard->focus_resource = NULL; - keyboard->focus_surface = NULL; -} - static void keyboard_handle_focus_surface_destroy (struct wl_listener *listener, void *data) { MetaWaylandKeyboard *keyboard = wl_container_of (listener, keyboard, focus_surface_listener); - release_focus (keyboard); + + wl_list_remove (&keyboard->focus_surface_listener.link); + keyboard->focus_surface = NULL; } static void keyboard_handle_focus_resource_destroy (struct wl_listener *listener, void *data) { MetaWaylandKeyboard *keyboard = wl_container_of (listener, keyboard, focus_resource_listener); - release_focus (keyboard); + + wl_list_remove (&keyboard->focus_resource_listener.link); + keyboard->focus_resource = NULL; } static gboolean diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 2a72fc1a5..88ced65e1 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -55,28 +55,22 @@ static void meta_wayland_pointer_end_popup_grab (MetaWaylandPointer *pointer); -static void -release_focus (MetaWaylandPointer *pointer) -{ - wl_list_remove (&pointer->focus_surface_listener.link); - wl_list_remove (&pointer->focus_resource_listener.link); - - pointer->focus_resource = NULL; - pointer->focus_surface = NULL; -} - static void pointer_handle_focus_surface_destroy (struct wl_listener *listener, void *data) { MetaWaylandPointer *pointer = wl_container_of (listener, pointer, focus_surface_listener); - release_focus (pointer); + + wl_list_remove (&pointer->focus_surface_listener.link); + pointer->focus_surface = NULL; } static void pointer_handle_focus_resource_destroy (struct wl_listener *listener, void *data) { MetaWaylandPointer *pointer = wl_container_of (listener, pointer, focus_resource_listener); - release_focus (pointer); + + wl_list_remove (&pointer->focus_resource_listener.link); + pointer->focus_resource = NULL; } static void @@ -302,7 +296,7 @@ meta_wayland_pointer_init (MetaWaylandPointer *pointer) void meta_wayland_pointer_release (MetaWaylandPointer *pointer) { - release_focus (pointer); + /* Do nothing. */ } static struct wl_resource *