aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-08-24 09:18:42 -0400
committerTony Crisci <tony@dubstepdish.com>2017-08-26 08:32:11 -0400
commit431e1ddeca29cc12699d3da6073f4d6b3f97530e (patch)
treea5d1130ecce0b9fb0f486c2dcfc02a4fff1cbe27
parent9978349903f8cc31c6dbf4a807c1f456ccecd5a4 (diff)
smooth pointer transitioning between outputs
-rw-r--r--types/wlr_cursor.c24
1 files changed, 14 insertions, 10 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 (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);
+ 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;
+
+ // 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;