diff options
-rw-r--r-- | types/wlr_cursor.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c index cf8f7359..e33b3ba7 100644 --- a/types/wlr_cursor.c +++ b/types/wlr_cursor.c @@ -265,6 +265,16 @@ static struct wlr_cursor_device *get_cursor_device(struct wlr_cursor *cur, return ret; } +static void output_cursor_move(struct wlr_cursor_output_cursor *output_cursor) { + struct wlr_cursor *cur = output_cursor->cursor; + + double output_x = cur->x, output_y = cur->y; + wlr_output_layout_output_coords(cur->state->layout, + output_cursor->output_cursor->output, &output_x, &output_y); + wlr_output_cursor_move(output_cursor->output_cursor, + output_x, output_y); +} + static void cursor_warp_unchecked(struct wlr_cursor *cur, double lx, double ly) { assert(cur->state->layout); @@ -273,17 +283,13 @@ static void cursor_warp_unchecked(struct wlr_cursor *cur, return; } + cur->x = lx; + cur->y = ly; + struct wlr_cursor_output_cursor *output_cursor; wl_list_for_each(output_cursor, &cur->state->output_cursors, link) { - double output_x = lx, output_y = ly; - wlr_output_layout_output_coords(cur->state->layout, - output_cursor->output_cursor->output, &output_x, &output_y); - wlr_output_cursor_move(output_cursor->output_cursor, - output_x, output_y); + output_cursor_move(output_cursor); } - - cur->x = lx; - cur->y = ly; } /** @@ -1104,6 +1110,7 @@ static void layout_add(struct wlr_cursor_state *state, &output_cursor->output_commit); output_cursor->output_commit.notify = output_cursor_output_handle_output_commit; + output_cursor_move(output_cursor); cursor_output_cursor_update(output_cursor); } |