diff options
author | bi4k8 <bi4k8-js7gse3b01w@mt2015.com> | 2022-12-20 19:56:51 +0000 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2022-12-20 20:01:56 +0000 |
commit | 790fb93794a471662c2f2eea4e7274baf346fbcd (patch) | |
tree | 78fe45fb01faad14b5220c4a887eb040934046ee | |
parent | 1cd53f54b77a1b54edf51fb13e3fb26d27c48538 (diff) |
cursor: compare to scaled coords
-rw-r--r-- | types/output/cursor.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/types/output/cursor.c b/types/output/cursor.c index 41d99c12..2ddff8cd 100644 --- a/types/output/cursor.c +++ b/types/output/cursor.c @@ -533,6 +533,10 @@ void wlr_output_cursor_set_surface(struct wlr_output_cursor *cursor, bool wlr_output_cursor_move(struct wlr_output_cursor *cursor, double x, double y) { + // Scale coordinates for the output + x *= cursor->output->scale; + y *= cursor->output->scale; + if (cursor->x == x && cursor->y == y) { return true; } @@ -541,11 +545,9 @@ bool wlr_output_cursor_move(struct wlr_output_cursor *cursor, output_cursor_damage_whole(cursor); } - bool was_visible = cursor->visible; - x *= cursor->output->scale; - y *= cursor->output->scale; cursor->x = x; cursor->y = y; + bool was_visible = cursor->visible; output_cursor_update_visible(cursor); if (!was_visible && !cursor->visible) { |