From d54b87c4559bd9d74fa10d3e3d1e38a933bea051 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 11 Feb 2015 00:58:42 -0800 Subject: [PATCH] screenshot: Use MetaCursorTracker to fetch the cursor position ClutterInputDevice will use the last place it knows the cursor to be, which isn't always up to date when running under X11. --- src/shell-screenshot.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/shell-screenshot.c b/src/shell-screenshot.c index 1ab146bad..076ea3f07 100644 --- a/src/shell-screenshot.c +++ b/src/shell-screenshot.c @@ -249,22 +249,6 @@ do_grab_screenshot (ShellScreenshot *screenshot, cogl_object_unref (bitmap); } -static void -get_pointer_coords (int *x, - int *y) -{ - ClutterDeviceManager *manager; - ClutterInputDevice *device; - ClutterPoint point; - - manager = clutter_device_manager_get_default (); - device = clutter_device_manager_get_device (manager, META_VIRTUAL_CORE_POINTER_ID); - - clutter_input_device_get_coords (device, NULL, &point); - *x = point.x; - *y = point.y; -} - static void _draw_cursor_image (MetaCursorTracker *tracker, cairo_surface_t *surface, @@ -281,7 +265,7 @@ _draw_cursor_image (MetaCursorTracker *tracker, int xhot, yhot; screenshot_region = cairo_region_create_rectangle (&area); - get_pointer_coords (&x, &y); + meta_cursor_tracker_get_pointer (tracker, &x, &y, NULL); if (!cairo_region_contains_point (screenshot_region, x, y)) {