diff options
author | emersion <contact@emersion.fr> | 2017-11-02 19:24:48 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-11-02 19:24:48 +0100 |
commit | 0384c9c094f923875aa17ea8be8b7574f4c96487 (patch) | |
tree | 3963d3ea4393b06130072a07d9210d1e8eeb73d8 | |
parent | 62734d05535bd0137f3239f3d7639438961868fe (diff) |
Process surface position for software cursor hotspots
-rw-r--r-- | types/wlr_output.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c index c4589487..24cc5892 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -279,10 +279,16 @@ static void output_cursor_render(struct wlr_output_cursor *cursor) { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + int x = cursor->x - cursor->hotspot_x; + int y = cursor->y - cursor->hotspot_y; + if (cursor->surface != NULL) { + x += cursor->surface->current->sx; + y += cursor->surface->current->sy; + } + float matrix[16]; - wlr_texture_get_matrix(texture, &matrix, - &cursor->output->transform_matrix, cursor->x - cursor->hotspot_x, - cursor->y - cursor->hotspot_y); + wlr_texture_get_matrix(texture, &matrix, &cursor->output->transform_matrix, + x, y); wlr_render_with_matrix(renderer, texture, &matrix); } |