From 649e1ce973dc25dbdfeef94283acaa83eac905f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 1 Aug 2012 09:46:12 -0400 Subject: [PATCH] compositor: Don't allow setting a NULL cursor without pointer focus --- src/compositor.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 9891b3c3..1dd579ad 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -2213,15 +2213,14 @@ pointer_set_cursor(struct wl_client *client, struct wl_resource *resource, surface = container_of(surface_resource->data, 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) 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,