compositor: Always allow owner of pointer surface to change the hotspot

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.
dev
Ander Conselvan de Oliveira 13 years ago committed by Kristian Høgsberg
parent 73694c832b
commit 1fbda0e81d
  1. 16
      src/compositor.c

@ -2173,23 +2173,27 @@ pointer_set_cursor(struct wl_client *client, struct wl_resource *resource,
struct weston_seat *seat = resource->data; struct weston_seat *seat = resource->data;
struct weston_surface *surface = NULL; struct weston_surface *surface = NULL;
if (surface_resource)
surface = container_of(surface_resource->data,
struct weston_surface, surface);
if (serial < seat->seat.pointer->focus_serial) if (serial < seat->seat.pointer->focus_serial)
return; return;
if (surface && surface != seat->sprite) {
if (seat->seat.pointer->focus == NULL) if (seat->seat.pointer->focus == NULL)
return; return;
if (seat->seat.pointer->focus->resource.client != client) if (seat->seat.pointer->focus->resource.client != client)
return; return;
if (surface_resource) if (surface->configure) {
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_resource_post_error(&surface->surface.resource,
WL_DISPLAY_ERROR_INVALID_OBJECT, WL_DISPLAY_ERROR_INVALID_OBJECT,
"surface->configure already set"); "surface->configure already "
"set");
return; return;
} }
}
if (seat->sprite) if (seat->sprite)
pointer_unmap_sprite(seat); pointer_unmap_sprite(seat);

Loading…
Cancel
Save