compositor: Don't allow setting a NULL cursor without pointer focus

dev
Kristian Høgsberg 13 years ago
parent ae27737b28
commit 649e1ce973
  1. 9
      src/compositor.c

@ -2213,15 +2213,14 @@ pointer_set_cursor(struct wl_client *client, struct wl_resource *resource,
surface = container_of(surface_resource->data, surface = container_of(surface_resource->data,
struct weston_surface, surface); struct weston_surface, surface);
if (seat->seat.pointer->focus == NULL)
return;
if (seat->seat.pointer->focus->resource.client != client)
return;
if (seat->seat.pointer->focus_serial - serial > UINT32_MAX / 2) if (seat->seat.pointer->focus_serial - serial > UINT32_MAX / 2)
return; return;
if (surface && surface != seat->sprite) { if (surface && surface != seat->sprite) {
if (seat->seat.pointer->focus == NULL)
return;
if (seat->seat.pointer->focus->resource.client != client)
return;
if (surface->configure) { if (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,

Loading…
Cancel
Save