From 431e1ddeca29cc12699d3da6073f4d6b3f97530e Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Thu, 24 Aug 2017 09:18:42 -0400 Subject: [PATCH] smooth pointer transitioning between outputs --- types/wlr_cursor.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c index 93ba3478..af977632 100644 --- a/types/wlr_cursor.c +++ b/types/wlr_cursor.c @@ -85,16 +85,20 @@ void wlr_cursor_move(struct wlr_cursor *cur, double delta_x, double delta_y) { hotspot_y = image->hotspot_y; } - struct wlr_output *output; - output = wlr_output_layout_output_at(cur->state->layout, new_x, new_y); + if (wlr_output_layout_output_at(cur->state->layout, new_x, new_y)) { + //struct wlr_output *output; + //output = wlr_output_layout_output_at(cur->state->layout, new_x, new_y); + struct wlr_output_layout_output *l_output; + wl_list_for_each(l_output, &cur->state->layout->outputs, link) { + int output_x = new_x; + int output_y = new_y; - if (output) { - int output_x = new_x; - int output_y = new_y; - - // TODO fix double to int rounding issues - wlr_output_layout_output_coords(cur->state->layout, output, &output_x, &output_y); - wlr_output_move_cursor(output, output_x - hotspot_x, output_y - hotspot_y); + // TODO fix double to int rounding issues + wlr_output_layout_output_coords(cur->state->layout, + l_output->output, &output_x, &output_y); + wlr_output_move_cursor(l_output->output, output_x - hotspot_x, + output_y - hotspot_y); + } cur->x = new_x; cur->y = new_y;