From: Kristian Høgsberg Date: Mon, 13 Aug 2012 22:14:15 +0000 (-0400) Subject: compositor: Use pointer_cursor_surface_configure() in wl_pointer.set_cursor X-Git-Tag: submit/trunk/20120814.155504~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3800e4788264c007da387f6edaff538ad78ce07;p=profile%2Fivi%2Fweston.git compositor: Use pointer_cursor_surface_configure() in wl_pointer.set_cursor This way we map the surface if it currently isn't mapped and avoid duplicating some of the code already in pointer_cursor_surface_configure(). Without this, the cursor code relied on a wl_surface.attach() to show the new pointer surface. If we're not changing the cursor buffer, we don't get that, but we still need to map the cursor. --- diff --git a/src/compositor.c b/src/compositor.c index 6e8afb6..7370435 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -2269,15 +2269,12 @@ pointer_set_cursor(struct wl_client *client, struct wl_resource *resource, surface->configure = pointer_cursor_surface_configure; surface->private = seat; - empty_region(&surface->input); - seat->sprite = surface; seat->hotspot_x = x; seat->hotspot_y = y; - weston_surface_set_position(surface, - wl_fixed_to_int(seat->seat.pointer->x) - x, - wl_fixed_to_int(seat->seat.pointer->y) - y); + if (surface->buffer) + pointer_cursor_surface_configure(surface, 0, 0); } static const struct wl_pointer_interface pointer_interface = {