diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2015-11-24 11:39:38 -0600 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2015-11-24 12:03:38 -0600 |
commit | be428b3825043cbcc676d2526fe6213bea7f676a (patch) | |
tree | d594e3e40e46e6439c3d78df50777700943a822f | |
parent | cd9bb710e7d6b23188ac354b3fec0246aa5f9c5c (diff) | |
download | weston-be428b3825043cbcc676d2526fe6213bea7f676a.tar.gz |
compositor-drm: Use view transform in cursor plane setup
Make sure a view's transform is viable for a cursor plane and
then actually apply it before setting the cursor plane location.
Now if a subsurface ends up in the cursor plane, the plane will be
properly positioned.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
-rw-r--r-- | src/compositor-drm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compositor-drm.c b/src/compositor-drm.c index a84d8695..65758474 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -1095,6 +1095,9 @@ drm_output_prepare_cursor_view(struct drm_output *output, (struct drm_backend *)output->base.compositor->backend; struct weston_buffer_viewport *viewport = &ev->surface->buffer_viewport; + if (ev->transform.enabled && + (ev->transform.matrix.type > WESTON_MATRIX_TRANSFORM_TRANSLATE)) + return NULL; if (b->gbm == NULL) return NULL; if (output->base.transform != WL_OUTPUT_TRANSFORM_NORMAL) @@ -1166,7 +1169,7 @@ drm_output_set_cursor(struct drm_output *output) (struct drm_backend *) output->base.compositor->backend; EGLint handle; struct gbm_bo *bo; - int x, y; + float x, y; output->cursor_view = NULL; if (ev == NULL) { @@ -1192,8 +1195,7 @@ drm_output_set_cursor(struct drm_output *output) } } - x = (ev->geometry.x - output->base.x) * output->base.current_scale; - y = (ev->geometry.y - output->base.y) * output->base.current_scale; + weston_view_to_global_float(ev, 0, 0, &x, &y); if (output->cursor_plane.x != x || output->cursor_plane.y != y) { if (drmModeMoveCursor(b->drm.fd, output->crtc_id, x, y)) { weston_log("failed to move cursor: %m\n"); |