aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/drm.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-03-12 21:50:07 -0400
committerGitHub <noreply@github.com>2018-03-12 21:50:07 -0400
commitefa9eeb5d5a8c01eac98cfe88913cfe2df3036c2 (patch)
treeb41177c487fbd951a85994e227478d73c8115427 /backend/drm/drm.c
parent647c2e68ba95316cabf5ce48d72aa27f1ea4fa24 (diff)
parentd24f868bbe36cb7129c668f934ee65d0911aff2d (diff)
Merge pull request #716 from emersion/fix-cursor-hotspot-update
Fix cursor hotspot update
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r--backend/drm/drm.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index fcadeb09..0d1d527d 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -602,12 +602,25 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
wlr_output_transform_invert(output->transform);
wlr_box_transform(&hotspot, transform,
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
+ if (plane->cursor_hotspot_x != hotspot.x ||
+ plane->cursor_hotspot_y != hotspot.y) {
+ // Update cursor hotspot
+ conn->cursor_x -= hotspot.x - plane->cursor_hotspot_x;
+ conn->cursor_y -= hotspot.y - plane->cursor_hotspot_y;
+ plane->cursor_hotspot_x = hotspot.x;
+ plane->cursor_hotspot_y = hotspot.y;
+
+ if (!drm->iface->crtc_move_cursor(drm, conn->crtc, conn->cursor_x,
+ conn->cursor_y)) {
+ return false;
+ }
+
wlr_output_update_needs_swap(output);
+ }
+
+ if (!update_pixels) {
+ // Don't update cursor image
return true;
}