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

Rob Bradford robert.bradford at intel.com
Mon Jul 22 09:31:39 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 8757097..7e308d6 100644
--- a/src/input.c
+++ b/src/input.c
@@ -453,8 +453,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;
 	}
 
@@ -492,8 +492,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;
 	}
 
@@ -999,8 +999,8 @@ 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