[Spice-devel] [PATCH spice-server 2/2] red-qxl: Enforce boolean for QXLDevSurfaceCreate::mouse_mode

Frediano Ziglio fziglio at redhat.com
Tue Oct 17 10:14:42 UTC 2017


In some cases mouse_mode is a bit field.
However for this structure is used always as a boolean
value.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/red-qxl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/red-qxl.c b/server/red-qxl.c
index e386ba629..8cf09d9a8 100644
--- a/server/red-qxl.c
+++ b/server/red-qxl.c
@@ -349,7 +349,8 @@ void red_qxl_create_primary_surface_complete(QXLState *qxl_state, const QXLDevSu
 {
     qxl_state->x_res = surface->width;
     qxl_state->y_res = surface->height;
-    qxl_state->use_hardware_cursor = surface->mouse_mode;
+    // mouse_mode is a boolean value, enforce it
+    qxl_state->use_hardware_cursor = !!surface->mouse_mode;
     qxl_state->primary_active = TRUE;
 
     reds_update_client_mouse_allowed(qxl_state->reds);
-- 
2.13.6



More information about the Spice-devel mailing list