Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
output: fix cursor surface position handling
Browse files Browse the repository at this point in the history
On commit, the surface position is a delta in surface-local
coordinates.
  • Loading branch information
emersion committed Jun 20, 2018
1 parent cc89906 commit 515c36d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions types/wlr_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,6 @@ static void output_cursor_get_box(struct wlr_output_cursor *cursor,
box->y = cursor->y - cursor->hotspot_y;
box->width = cursor->width;
box->height = cursor->height;

if (cursor->surface != NULL) {
box->x += cursor->surface->current->sx * cursor->output->scale;
box->y += cursor->surface->current->sy * cursor->output->scale;
}
}

static void output_cursor_render(struct wlr_output_cursor *cursor,
Expand Down Expand Up @@ -767,6 +762,8 @@ static void output_cursor_commit(struct wlr_output_cursor *cursor) {
cursor->enabled = wlr_surface_has_buffer(cursor->surface);
cursor->width = cursor->surface->current->width * cursor->output->scale;
cursor->height = cursor->surface->current->height * cursor->output->scale;
cursor->x += cursor->surface->current->sx * cursor->output->scale;
cursor->y += cursor->surface->current->sy * cursor->output->scale;

if (output_cursor_attempt_hardware(cursor)) {
struct timespec now;
Expand Down

0 comments on commit 515c36d

Please sign in to comment.