aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-12-08 14:40:57 +0100
committeremersion <contact@emersion.fr>2017-12-08 14:40:57 +0100
commit15bb9a53b438eb37ed5ae7c0836b7ec8a3b6b35e (patch)
treeb98ef734c63b87e8fed0bec994c7db6379cc427d
parent5dc303fc26a765c3cff26fe1ee8e5b492d64f2d7 (diff)
Fix unscaled cursor sx, sy
-rw-r--r--types/wlr_output.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c
index b4ee4176..f4ae7aaa 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -310,6 +310,9 @@ static void output_fullscreen_surface_render(struct wlr_output *output,
wlr_surface_send_frame_done(surface, when);
}
+/**
+ * Returns the cursor box, scaled for its output.
+ */
static void output_cursor_get_box(struct wlr_output_cursor *cursor,
struct wlr_box *box) {
box->x = cursor->x - cursor->hotspot_x;
@@ -318,8 +321,8 @@ static void output_cursor_get_box(struct wlr_output_cursor *cursor,
box->height = cursor->height;
if (cursor->surface != NULL) {
- box->x += cursor->surface->current->sx;
- box->y += cursor->surface->current->sy;
+ box->x += cursor->surface->current->sx * cursor->output->scale;
+ box->y += cursor->surface->current->sy * cursor->output->scale;
}
}