[PATCH v2 weston 05/16] compositor-drm: Fix cursor view size check

Daniel Stone daniels at collabora.com
Mon Jun 22 09:25:10 PDT 2015


Instead of testing against a hardcoded 64x64 pixel size to see if a view
is suitable for promotion to a cursor plane, use our cursor_width and
cursor_height variables.

Signed-off-by: Daniel Stone <daniels at collabora.com>
---
 src/compositor-drm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index f8ba427..30d1223 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -125,8 +125,8 @@ struct drm_compositor {
 
 	struct udev_input input;
 
-	uint32_t cursor_width;
-	uint32_t cursor_height;
+	int32_t cursor_width;
+	int32_t cursor_height;
 };
 
 struct drm_mode {
@@ -1013,7 +1013,8 @@ drm_output_prepare_cursor_view(struct drm_output *output,
 		return NULL;
 	if (ev->surface->buffer_ref.buffer == NULL ||
 	    !wl_shm_buffer_get(ev->surface->buffer_ref.buffer->resource) ||
-	    ev->surface->width > 64 || ev->surface->height > 64)
+	    ev->surface->width > c->cursor_width ||
+	    ev->surface->height > c->cursor_height)
 		return NULL;
 
 	output->cursor_view = ev;
-- 
2.4.3



More information about the wayland-devel mailing list