mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-30 00:15:58 +01:00
Process surface position for software cursor hotspots
This commit is contained in:
parent
62734d0553
commit
0384c9c094
1 changed files with 9 additions and 3 deletions
|
@ -279,10 +279,16 @@ static void output_cursor_render(struct wlr_output_cursor *cursor) {
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
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];
|
float matrix[16];
|
||||||
wlr_texture_get_matrix(texture, &matrix,
|
wlr_texture_get_matrix(texture, &matrix, &cursor->output->transform_matrix,
|
||||||
&cursor->output->transform_matrix, cursor->x - cursor->hotspot_x,
|
x, y);
|
||||||
cursor->y - cursor->hotspot_y);
|
|
||||||
wlr_render_with_matrix(renderer, texture, &matrix);
|
wlr_render_with_matrix(renderer, texture, &matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue