[PATCH weston 2/4] input: Use a client destroy listener for resetting the focus resource

Rob Bradford robert.bradford at intel.com
Fri Sep 6 09:48:20 PDT 2013


From: Rob Bradford <rob at linux.intel.com>

This is currently equivalent as there is no way for the pointer, keyboard
or touch resource to be destroyed without the client being destroyed.
This removes another place where a single resource for the focus is
assumed.
---
 src/input.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/input.c b/src/input.c
index e6d074e..7344c4d 100644
--- a/src/input.c
+++ b/src/input.c
@@ -451,8 +451,8 @@ weston_pointer_set_focus(struct weston_pointer *pointer,
 		}
 		wl_pointer_send_enter(resource, serial, surface->resource,
 				      sx, sy);
-		wl_resource_add_destroy_listener(resource,
-						 &pointer->focus_listener);
+		wl_client_add_destroy_listener(wl_resource_get_client(surface->resource),
+					       &pointer->focus_listener);
 		pointer->focus_serial = serial;
 	}
 
@@ -490,8 +490,8 @@ weston_keyboard_set_focus(struct weston_keyboard *keyboard,
 					   keyboard->modifiers.group);
 		wl_keyboard_send_enter(resource, serial, surface->resource,
 				       &keyboard->keys);
-		wl_resource_add_destroy_listener(resource,
-						 &keyboard->focus_listener);
+		wl_client_add_destroy_listener(wl_resource_get_client(surface->resource),
+					       &keyboard->focus_listener);
 		keyboard->focus_serial = serial;
 	}
 
@@ -997,8 +997,8 @@ weston_touch_set_focus(struct weston_seat *seat, struct weston_surface *surface)
 
 		seat->touch->focus = surface;
 		seat->touch->focus_resource = resource;
-		wl_resource_add_destroy_listener(resource,
-						 &seat->touch->focus_listener);
+		wl_client_add_destroy_listener(wl_resource_get_client(surface->resource),
+					       &seat->touch->focus_listener);
 	}
 }
 
-- 
1.8.3.1



More information about the wayland-devel mailing list