From bbec66c2d838616e73cc507c1d4d6bb8c6e21aa9 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 16 Apr 2014 14:49:30 -0400 Subject: [PATCH] pointer/keyboard: Surfaces should always have resources There's no possible way that they shouldn't. --- src/wayland/meta-wayland-keyboard.c | 11 ++++------- src/wayland/meta-wayland-pointer.c | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index 302b57999..535674410 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -439,13 +439,10 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard, { if (keyboard->focus_resource) { - if (keyboard->focus_surface->resource) - { - struct wl_client *client = wl_resource_get_client (keyboard->focus_resource); - struct wl_display *display = wl_client_get_display (client); - uint32_t serial = wl_display_next_serial (display); - wl_keyboard_send_leave (keyboard->focus_resource, serial, keyboard->focus_surface->resource); - } + struct wl_client *client = wl_resource_get_client (keyboard->focus_resource); + struct wl_display *display = wl_client_get_display (client); + uint32_t serial = wl_display_next_serial (display); + wl_keyboard_send_leave (keyboard->focus_resource, serial, keyboard->focus_surface->resource); wl_list_remove (&keyboard->focus_resource_listener.link); keyboard->focus_resource = NULL; diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index ad7b6a7eb..8971e1ed3 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -327,13 +327,10 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer, { if (pointer->focus_resource) { - if (pointer->focus_surface->resource) - { - struct wl_client *client = wl_resource_get_client (pointer->focus_resource); - struct wl_display *display = wl_client_get_display (client); - uint32_t serial = wl_display_next_serial (display); - wl_pointer_send_leave (pointer->focus_resource, serial, pointer->focus_surface->resource); - } + struct wl_client *client = wl_resource_get_client (pointer->focus_resource); + struct wl_display *display = wl_client_get_display (client); + uint32_t serial = wl_display_next_serial (display); + wl_pointer_send_leave (pointer->focus_resource, serial, pointer->focus_surface->resource); wl_list_remove (&pointer->focus_resource_listener.link); pointer->focus_resource = NULL;