[Spice-devel] [PATCH spice-gtk v3] widget: Set cursor during construction

Victor Toso victortoso at redhat.com
Fri May 26 13:30:42 UTC 2017


Hi,

On Fri, May 26, 2017 at 03:08:36PM +0200, Pavel Grunt wrote:
> In a multimonitor environment can easily happen that a cursor is set
> before some of the SpiceDisplays are created. IOW the first created
> SpiceDisplay has the cursor but others don't.
> 
> To avoid the issue set the initial cursor using the "cursor" property
> of the SpiceCursorChannel.
> 
> Resolves:
> https://bugzilla.redhat.com/show_bug.cgi?id=1411380
> ---
> Avoid changing the cursor_set logic in a single commit

Sure
Acked-by: Victor Toso <victortoso at redhat.com>
> ---
>  src/spice-widget.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index b0ad428..d42924b 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -2958,6 +2958,7 @@ static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data)
>      }
>  
>      if (SPICE_IS_CURSOR_CHANNEL(channel)) {
> +        gpointer cursor_shape;
>          if (id != d->channel_id)
>              return;
>          d->cursor = SPICE_CURSOR_CHANNEL(channel);
> @@ -2970,6 +2971,11 @@ static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data)
>          spice_g_signal_connect_object(channel, "cursor-reset",
>                                        G_CALLBACK(cursor_reset), display, 0);
>          spice_channel_connect(channel);
> +
> +        g_object_get(G_OBJECT(channel), "cursor", &cursor_shape, NULL);
> +        if (cursor_shape != NULL) {
> +            cursor_set(d->cursor, NULL, display);
> +        }
>          return;
>      }
>  
> -- 
> 2.13.0
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170526/9e4697f1/attachment.sig>


More information about the Spice-devel mailing list