compositor: weston_output_set_cursor() to use bounding box
authorPekka Paalanen <ppaalanen@gmail.com>
Thu, 26 Jan 2012 09:31:01 +0000 (11:31 +0200)
committerPekka Paalanen <ppaalanen@gmail.com>
Fri, 27 Jan 2012 14:15:02 +0000 (16:15 +0200)
If we ever have transformed cursor surfaces, we would better use the
bounding box to check if it is on the given output.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
src/compositor.c

index a2065e7..050227f 100644 (file)
@@ -846,13 +846,12 @@ weston_output_set_cursor(struct weston_output *output,
        if (device->sprite == NULL)
                return;
 
-       pixman_region32_init_rect(&cursor_region,
-                                 device->sprite->geometry.x,
-                                 device->sprite->geometry.y,
-                                 device->sprite->geometry.width,
-                                 device->sprite->geometry.height);
+       weston_surface_update_transform(device->sprite);
 
-       pixman_region32_intersect(&cursor_region, &cursor_region, &output->region);
+       pixman_region32_init(&cursor_region);
+       pixman_region32_intersect(&cursor_region,
+                                 &device->sprite->transform.boundingbox,
+                                 &output->region);
 
        if (!pixman_region32_not_empty(&cursor_region)) {
                output->set_hardware_cursor(output, NULL);