[Spice-devel] [PATCH spice-server 2/2] red-qxl: Enforce boolean for QXLDevSurfaceCreate::mouse_mode
Jonathon Jongsma
jjongsma at redhat.com
Tue Oct 17 20:17:24 UTC 2017
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
On Tue, 2017-10-17 at 11:14 +0100, Frediano Ziglio wrote:
> 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);
More information about the Spice-devel
mailing list