diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-25 23:03:30 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-11-01 08:51:59 -0400 |
commit | c8f97a3a2c43948147e4225e09437884a848fa9d (patch) | |
tree | ea9bfd02715afc16df2cefba51e425c8ff49281b | |
parent | bafb97087121dbeab83ffc7d2e571d4c53d1f000 (diff) |
Use surface matrix for software cursors
A similar change should probably be applied to hardware cursors, though
more complicated. Also, this doesn't actually fix the issue where the
cursor is too small when over a scale=2 surface. Apparently they don't
set their cursor scales to 2. Seems like a client bug? idk
-rw-r--r-- | types/wlr_output.c | 13 | ||||
-rw-r--r-- | types/wlr_surface.c | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c index d6efd9bf..4bc9d6aa 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -429,8 +429,17 @@ void wlr_output_swap_buffers(struct wlr_output *output) { // with a NULL buffer to hide it if (renderer && texture && texture->valid) { float matrix[16]; - wlr_texture_get_matrix(texture, &matrix, &output->transform_matrix, - output->cursor.x, output->cursor.y); + if (output->cursor.surface) { + float translation[16]; + wlr_matrix_translate(&translation, + output->cursor.x, output->cursor.y, 0); + wlr_surface_get_matrix(output->cursor.surface, + &matrix, &output->transform_matrix, &translation); + } else { + wlr_texture_get_matrix(texture, + &matrix, &output->transform_matrix, + output->cursor.x, output->cursor.y); + } wlr_render_with_matrix(renderer, texture, &matrix); } } diff --git a/types/wlr_surface.c b/types/wlr_surface.c index a21be8de..a6f91d47 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -656,7 +656,7 @@ void wlr_surface_get_matrix(struct wlr_surface *surface, if (transform) { wlr_matrix_mul(matrix, transform, matrix); } - wlr_matrix_scale(&scale, width, height, surface->current->scale); + wlr_matrix_scale(&scale, width, height, 1); wlr_matrix_mul(matrix, &scale, matrix); wlr_matrix_mul(projection, matrix, matrix); } |