Skip to content

Commit b558e62

Browse files
committed
src: Adapt to MetaPointerTracker changes in linuxmint/muffin#765.
meta_cursor_tracker_get_pointer() now expects a single graphene_point_t out-argument instead of x, y.
1 parent 03e9990 commit b558e62

4 files changed

Lines changed: 19 additions & 13 deletions

File tree

src/cinnamon-global.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,10 +1283,13 @@ cinnamon_global_get_pointer (CinnamonGlobal *global,
12831283
{
12841284
ClutterModifierType raw_mods;
12851285
MetaCursorTracker *tracker;
1286+
graphene_point_t coords;
12861287

12871288
tracker = meta_cursor_tracker_get_for_display (global->meta_display);
1288-
meta_cursor_tracker_get_pointer (tracker, x, y, &raw_mods);
1289+
meta_cursor_tracker_get_pointer (tracker, &coords, &raw_mods);
12891290

1291+
*x = (int) coords.x;
1292+
*y = (int) coords.y;
12901293
*mods = raw_mods & CLUTTER_MODIFIER_MASK;
12911294
}
12921295

src/cinnamon-recorder.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,14 +578,14 @@ on_cursor_changed (MetaCursorTracker *tracker,
578578
static void
579579
recorder_update_pointer (CinnamonRecorder *recorder)
580580
{
581-
int pointer_x, pointer_y;
581+
graphene_point_t coords;
582582

583-
meta_cursor_tracker_get_pointer (recorder->cursor_tracker, &pointer_x, &pointer_y, NULL);
583+
meta_cursor_tracker_get_pointer (recorder->cursor_tracker, &coords, NULL);
584584

585-
if (pointer_x != recorder->pointer_x || pointer_y != recorder->pointer_y)
585+
if ((int) coords.x != recorder->pointer_x || (int) coords.y != recorder->pointer_y)
586586
{
587-
recorder->pointer_x = pointer_x;
588-
recorder->pointer_y = pointer_y;
587+
recorder->pointer_x = (int) coords.x;
588+
recorder->pointer_y = (int) coords.y;
589589
recorder_queue_redraw (recorder);
590590
}
591591
}

src/cinnamon-screen.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,12 +519,15 @@ cinnamon_screen_get_mouse_window (CinnamonScreen *screen,
519519

520520
MetaCursorTracker *cursor_tracker = meta_cursor_tracker_get_for_display (screen->display);
521521
GList *actors, *l;
522+
graphene_point_t coords;
522523
int mx, my;
523524

524525
if (not_this_one)
525526
g_debug ("Focusing mouse window excluding %s", meta_window_get_description (not_this_one));
526527

527-
meta_cursor_tracker_get_pointer (cursor_tracker, &mx, &my, NULL);
528+
meta_cursor_tracker_get_pointer (cursor_tracker, &coords, NULL);
529+
mx = (int) coords.x;
530+
my = (int) coords.y;
528531

529532
/* Bottom to top */
530533
actors = meta_get_window_actors (screen->display);

src/cinnamon-screenshot.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ _draw_cursor_image (cairo_surface_t *surface,
141141
cairo_surface_t *cursor_surface;
142142
cairo_region_t *screenshot_region;
143143
cairo_t *cr;
144-
int x, y;
144+
graphene_point_t coords;
145145
int xhot, yhot;
146146
double xscale, yscale;
147147

@@ -153,9 +153,9 @@ _draw_cursor_image (cairo_surface_t *surface,
153153
return;
154154

155155
screenshot_region = cairo_region_create_rectangle (&area);
156-
meta_cursor_tracker_get_pointer (tracker, &x, &y, NULL);
156+
meta_cursor_tracker_get_pointer (tracker, &coords, NULL);
157157

158-
if (!cairo_region_contains_point (screenshot_region, x, y))
158+
if (!cairo_region_contains_point (screenshot_region, (int) coords.x, (int) coords.y))
159159
{
160160
cairo_region_destroy (screenshot_region);
161161
return;
@@ -181,7 +181,7 @@ _draw_cursor_image (cairo_surface_t *surface,
181181
int monitor;
182182
float monitor_scale;
183183
MetaRectangle cursor_rect = {
184-
.x = x, .y = y, .width = width, .height = height
184+
.x = (int) coords.x, .y = (int) coords.y, .width = width, .height = height
185185
};
186186

187187
monitor = meta_display_get_monitor_index_for_rect (display, &cursor_rect);
@@ -193,8 +193,8 @@ _draw_cursor_image (cairo_surface_t *surface,
193193
cr = cairo_create (surface);
194194
cairo_set_source_surface (cr,
195195
cursor_surface,
196-
x - xhot - area.x,
197-
y - yhot - area.y);
196+
(int) coords.x - xhot - area.x,
197+
(int) coords.y - yhot - area.y);
198198
cairo_paint (cr);
199199

200200
cairo_destroy (cr);

0 commit comments

Comments
 (0)