diff options
author | emersion <contact@emersion.fr> | 2018-01-30 10:23:35 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-01-30 10:23:35 +0100 |
commit | d498855b9d6f8d7f0ccde42a026fb0619d99b8a2 (patch) | |
tree | 2b4e445864bd7486973c4b33ad828d37e6c4c036 /backend/drm | |
parent | d0961a02af36aee2b051ac6775c928a1f64ebc70 (diff) |
backend/drm: fix hw cursor position on rotated and scaled outputs
output: add wlr_output_transformed_resolution
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index a1227d15..1b0b9b2b 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -591,11 +591,10 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output, }; enum wl_output_transform transform = wlr_output_transform_invert(output->transform); - struct wlr_box transformed_hotspot; wlr_box_transform(&hotspot, transform, - plane->surf.width, plane->surf.height, &transformed_hotspot); - plane->cursor_hotspot_x = transformed_hotspot.x; - plane->cursor_hotspot_y = transformed_hotspot.y; + plane->surf.width, plane->surf.height, &hotspot); + plane->cursor_hotspot_x = hotspot.x; + plane->cursor_hotspot_y = hotspot.y; if (!update_pixels) { // Only update the cursor hotspot @@ -660,20 +659,18 @@ static bool wlr_drm_connector_move_cursor(struct wlr_output *output, struct wlr_box box = { .x = x, .y = y }; int width, height; - wlr_output_effective_resolution(output, &width, &height); + wlr_output_transformed_resolution(output, &width, &height); enum wl_output_transform transform = wlr_output_transform_invert(output->transform); - struct wlr_box transformed_box; - wlr_box_transform(&box, transform, width, height, &transformed_box); + wlr_box_transform(&box, transform, width, height, &box); if (plane != NULL) { - transformed_box.x -= plane->cursor_hotspot_x; - transformed_box.y -= plane->cursor_hotspot_y; + box.x -= plane->cursor_hotspot_x; + box.y -= plane->cursor_hotspot_y; } - bool ok = drm->iface->crtc_move_cursor(drm, conn->crtc, transformed_box.x, - transformed_box.y); + bool ok = drm->iface->crtc_move_cursor(drm, conn->crtc, box.x, box.y); if (ok) { wlr_output_update_needs_swap(output); } |