[PATCH weston 2/4] compositor: Always allow owner of pointer surface to change the hotspot

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Thu Jun 28 08:08:04 PDT 2012


Make pointer_set_cursor() succeed if a client that doesn't have pointer
focus but is the owner of the current pointer surface calls it.
---
 src/compositor.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index b4e430b..33b1aa8 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2168,22 +2168,26 @@ pointer_set_cursor(struct wl_client *client, struct wl_resource *resource,
 	struct weston_seat *seat = resource->data;
 	struct weston_surface *surface = NULL;
 
-	if (serial < seat->seat.pointer->focus_serial)
-		return;
-	if (seat->seat.pointer->focus == NULL)
-		return;
-	if (seat->seat.pointer->focus->resource.client != client)
-		return;
-
 	if (surface_resource)
 		surface = container_of(surface_resource->data,
 				       struct weston_surface, surface);
 
-	if (surface && surface != seat->sprite && surface->configure) {
-		wl_resource_post_error(&surface->surface.resource,
-				       WL_DISPLAY_ERROR_INVALID_OBJECT,
-				       "surface->configure already set");
+	if (serial < seat->seat.pointer->focus_serial)
 		return;
+
+	if (surface && surface != seat->sprite) {
+		if (seat->seat.pointer->focus == NULL)
+			return;
+		if (seat->seat.pointer->focus->resource.client != client)
+			return;
+
+		if (surface->configure) {
+			wl_resource_post_error(&surface->surface.resource,
+					       WL_DISPLAY_ERROR_INVALID_OBJECT,
+					       "surface->configure already "
+					       "set");
+			return;
+		}
 	}
 
 	if (seat->sprite)
-- 
1.7.4.1



More information about the wayland-devel mailing list