diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-10-31 17:58:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-31 17:58:28 -0400 |
commit | c7c0d34e920dea27cab3b88c50b1202343a54435 (patch) | |
tree | 6966addb32a19e5c9606d0cbded7f922fb372461 /backend/drm/drm.c | |
parent | 7200d643363e988edf6777c38e7f8fcd451a2c50 (diff) | |
parent | ec22fe713445977c1a122572107495b584117b16 (diff) |
Merge pull request #352 from emersion/output-cursor
Add wlr_output_cursor
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r-- | backend/drm/drm.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 27a8490c..6cbb0535 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -560,33 +560,36 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output, switch (output->transform) { case WL_OUTPUT_TRANSFORM_90: - output->cursor.hotspot_x = hotspot_x; - output->cursor.hotspot_y = -plane->surf.height + hotspot_y; + plane->cursor_hotspot_x = hotspot_x; + plane->cursor_hotspot_y = -plane->surf.height + hotspot_y; break; case WL_OUTPUT_TRANSFORM_180: - output->cursor.hotspot_x = plane->surf.width - hotspot_x; - output->cursor.hotspot_y = plane->surf.height - hotspot_y; + plane->cursor_hotspot_x = plane->surf.width - hotspot_x; + plane->cursor_hotspot_y = plane->surf.height - hotspot_y; break; case WL_OUTPUT_TRANSFORM_270: - output->cursor.hotspot_x = -plane->surf.height + hotspot_x; - output->cursor.hotspot_y = hotspot_y; + plane->cursor_hotspot_x = -plane->surf.height + hotspot_x; + plane->cursor_hotspot_y = hotspot_y; break; case WL_OUTPUT_TRANSFORM_FLIPPED: - output->cursor.hotspot_x = plane->surf.width - hotspot_x; - output->cursor.hotspot_y = hotspot_y; + plane->cursor_hotspot_x = plane->surf.width - hotspot_x; + plane->cursor_hotspot_y = hotspot_y; break; case WL_OUTPUT_TRANSFORM_FLIPPED_90: - output->cursor.hotspot_x = hotspot_x; - output->cursor.hotspot_y = -hotspot_y; + plane->cursor_hotspot_x = hotspot_x; + plane->cursor_hotspot_y = -hotspot_y; break; case WL_OUTPUT_TRANSFORM_FLIPPED_180: - output->cursor.hotspot_x = hotspot_x; - output->cursor.hotspot_y = plane->surf.height - hotspot_y; + plane->cursor_hotspot_x = hotspot_x; + plane->cursor_hotspot_y = plane->surf.height - hotspot_y; break; case WL_OUTPUT_TRANSFORM_FLIPPED_270: - output->cursor.hotspot_x = -plane->surf.height + hotspot_x; - output->cursor.hotspot_y = plane->surf.width - hotspot_y; + plane->cursor_hotspot_x = -plane->surf.height + hotspot_x; + plane->cursor_hotspot_y = plane->surf.width - hotspot_y; break; + default: // WL_OUTPUT_TRANSFORM_NORMAL + plane->cursor_hotspot_x = hotspot_x; + plane->cursor_hotspot_y = hotspot_y; } if (!update_pixels) { @@ -636,6 +639,10 @@ static bool wlr_drm_connector_move_cursor(struct wlr_output *output, struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output; struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend; + struct wlr_drm_plane *plane = conn->crtc->cursor; + x -= plane->cursor_hotspot_x; + y -= plane->cursor_hotspot_y; + int width, height, tmp; wlr_output_effective_resolution(output, &width, &height); |