Re: [PATCH spice-gtk 2/4] main: do not always request client mouse mode

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

 



On Mon, Nov 9, 2015 at 3:02 PM, Marc-André Lureau
<marcandre.lureau@xxxxxxxxxx> wrote:
>      out = spice_msg_out_new(SPICE_CHANNEL(channel), SPICE_MSGC_MAIN_MOUSE_MODE_REQUEST);
>      out->marshallers->msgc_main_mouse_mode_request(out->marshaller, &req);
>      spice_msg_out_send(out);
> @@ -1648,20 +1654,11 @@ static void set_mouse_mode(SpiceMainChannel *channel, uint32_t supported, uint32
>          c->mouse_mode = current;
>          g_coroutine_signal_emit(channel, signals[SPICE_MAIN_MOUSE_UPDATE], 0);
>          g_coroutine_object_notify(G_OBJECT(channel), "mouse-mode");
> -    }
>
> -    /* switch to client mode if possible */
> -    if (!spice_channel_get_read_only(SPICE_CHANNEL(channel)) &&
> -        supported & SPICE_MOUSE_MODE_CLIENT &&
> -        current != SPICE_MOUSE_MODE_CLIENT) {
> -        SpiceMsgcMainMouseModeRequest req = {
> -            .mode = SPICE_MOUSE_MODE_CLIENT,
> -        };
> -        SpiceMsgOut *out;
> -
> -        out = spice_msg_out_new(SPICE_CHANNEL(channel), SPICE_MSGC_MAIN_MOUSE_MODE_REQUEST);
> -        out->marshallers->msgc_main_mouse_mode_request(out->marshaller, &req);
> -        spice_msg_out_send_internal(out);
> +        if (c->requested_mouse_mode != c->mouse_mode &&
> +            c->requested_mouse_mode & supported) {
> +            spice_main_request_mouse_mode(SPICE_MAIN_CHANNEL(channel), c->requested_mouse_mode);
> +        }
>      }
>  }


actually I moved this added block outside of the first c->mouse_mode =
current block:

+    if (c->requested_mouse_mode != c->mouse_mode &&
+        c->requested_mouse_mode & supported) {
+        spice_main_request_mouse_mode(SPICE_MAIN_CHANNEL(channel),
c->requested_mouse_mode);
     }

That works much better as intended.

-- 
Marc-André Lureau
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




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