Re: [PATCH spice] Count display channels for tablet mode check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Having a single QXL interface is not enough, there can be other (e.g.
> streaming) display channels that make the tablet unusable. Add a check for
> the
> number of display channels also being equal to 1. We still need the check for
> QXL interaces, because the tablet only works with QXL.
> 
> Signed-off-by: Lukáš Hrázký <lhrazky@xxxxxxxxxx>
> ---
>  server/reds.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/server/reds.c b/server/reds.c
> index 85043a88..4f890348 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -651,9 +651,20 @@ static void reds_update_mouse_mode(RedsState *reds)
>  {
>      int allowed = 0;
>      int qxl_count = g_list_length(reds->qxl_instances);
> +    int display_channel_count = 0;
> +    RedChannel *channel;
> +
> +    GLIST_FOREACH(reds->channels, RedChannel, channel) {
> +        uint32_t this_type;
> +        g_object_get(channel, "channel-type", &this_type, NULL);
> +        if (this_type == SPICE_CHANNEL_DISPLAY) {
> +            ++display_channel_count;
> +        }
> +    }
>  
>      if ((reds->config->agent_mouse && reds->vdagent) ||
> -        (inputs_channel_has_tablet(reds->inputs_channel) && qxl_count == 1))
> {
> +        (inputs_channel_has_tablet(reds->inputs_channel) &&
> +            qxl_count == 1 && display_channel_count == 1)) {
>          allowed = reds->dispatcher_allows_client_mouse;
>      }
>      if (allowed == reds->is_client_mouse_allowed) {

Acked-by: Frediano Ziglio <fziglio@xxxxxxxxxx>

OT: all this mouse handling is pretty spread all around the code, maybe would
be good to have some additional comments.

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]