[gnome-shell/wip/carlosg/input-thread: 23/23] shell: Update to MetaCursorTracker API change
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/input-thread: 23/23] shell: Update to MetaCursorTracker API change
- Date: Tue, 6 Oct 2020 16:17:46 +0000 (UTC)
commit ff6c0ca68cfa0caa7fef6c487244ccb54aa958a8
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jul 20 12:08:43 2020 +0200
shell: Update to MetaCursorTracker API change
The pointer coordinates in meta_cursor_tracker_get_pointer() are now
returned as a graphene_point_t.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1405
src/shell-global.c | 8 +++++++-
src/shell-screenshot.c | 7 +++++--
2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/shell-global.c b/src/shell-global.c
index 7846f73006..8ddaa4e46f 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -1361,9 +1361,15 @@ shell_global_get_pointer (ShellGlobal *global,
{
ClutterModifierType raw_mods;
MetaCursorTracker *tracker;
+ graphene_point_t point;
tracker = meta_cursor_tracker_get_for_display (global->meta_display);
- meta_cursor_tracker_get_pointer (tracker, x, y, &raw_mods);
+ meta_cursor_tracker_get_pointer (tracker, &point, &raw_mods);
+
+ if (x)
+ *x = point.x;
+ if (y)
+ *y = point.y;
*mods = raw_mods & CLUTTER_MODIFIER_MASK;
}
diff --git a/src/shell-screenshot.c b/src/shell-screenshot.c
index 3a1c92ccec..ff81ce3388 100644
--- a/src/shell-screenshot.c
+++ b/src/shell-screenshot.c
@@ -181,6 +181,7 @@ draw_cursor_image (cairo_surface_t *surface,
int x, y;
int xhot, yhot;
double xscale, yscale;
+ graphene_point_t point;
display = shell_global_get_display (shell_global_get ());
tracker = meta_cursor_tracker_get_for_display (display);
@@ -190,9 +191,11 @@ draw_cursor_image (cairo_surface_t *surface,
return;
screenshot_region = cairo_region_create_rectangle (&area);
- meta_cursor_tracker_get_pointer (tracker, &x, &y, NULL);
+ meta_cursor_tracker_get_pointer (tracker, &point, NULL);
+ x = point.x;
+ y = point.y;
- if (!cairo_region_contains_point (screenshot_region, x, y))
+ if (!cairo_region_contains_point (screenshot_region, point.x, point.y))
{
cairo_region_destroy (screenshot_region);
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]