summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-02-05 15:55:20 -0600
committerBryce Harrington <bryce@bryceharrington.org>2016-02-09 13:04:31 -0800
commitb0427569fd4a9ef40a4bd59c412f5ab9b17b944d (patch)
tree1d3cf616511148d0e486888636b37bb0ac796b27
parent345b4f5b119d20ace14a6cb4a96a8b1d91c05659 (diff)
downloadweston-b0427569fd4a9ef40a4bd59c412f5ab9b17b944d.tar.gz
compositor-drm: update internal cursor plane location when disabling cursor
When the cursor plane is disabled the kernel can lose its location. If we don't update our internal idea of where the plane is at that time, the next time we set a cursor it can show up at 0,0. This can show up when an application is put in the cursor plane, removed from the plane, then put back at the same location. It might show up at 0,0 when it's reinstated. We now use INT32_MIN as a location for disabled cursors so enabling the plane will always cause an update. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
-rw-r--r--src/compositor-drm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 8b9882e6..76668627 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1174,6 +1174,8 @@ drm_output_set_cursor(struct drm_output *output)
output->cursor_view = NULL;
if (ev == NULL) {
drmModeSetCursor(b->drm.fd, output->crtc_id, 0, 0, 0);
+ output->cursor_plane.x = INT32_MIN;
+ output->cursor_plane.y = INT32_MIN;
return;
}
@@ -2430,7 +2432,8 @@ create_output_for_connector(struct drm_backend *b,
output->base.gamma_size = output->original_crtc->gamma_size;
output->base.set_gamma = drm_output_set_gamma;
- weston_plane_init(&output->cursor_plane, b->compositor, 0, 0);
+ weston_plane_init(&output->cursor_plane, b->compositor,
+ INT32_MIN, INT32_MIN);
weston_plane_init(&output->fb_plane, b->compositor, 0, 0);
weston_compositor_stack_plane(b->compositor, &output->cursor_plane, NULL);