[Spice-devel] [PATCH spice-gtk] widget: don't redraw server mouse until moved
Christophe Fergeau
cfergeau at redhat.com
Tue Nov 13 06:17:14 PST 2012
ACK
Christophe
On Mon, Nov 12, 2012 at 09:25:30PM +0100, Marc-André Lureau wrote:
> When switching between client mode and server mode, the pointer is
> being invalidated on each display and the cursor will end up being
> drawn on both. Since there is no information on which display the
> cursor is supposed to be until a move is received, hide the cursor
> until it actually moves.
> ---
> gtk/spice-widget-cairo.c | 1 +
> gtk/spice-widget.c | 3 ++-
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/gtk/spice-widget-cairo.c b/gtk/spice-widget-cairo.c
> index 9ddbe51..bd8e351 100644
> --- a/gtk/spice-widget-cairo.c
> +++ b/gtk/spice-widget-cairo.c
> @@ -135,6 +135,7 @@ void spicex_draw_event(SpiceDisplay *display, cairo_t *cr)
> cairo_fill(cr);
>
> if (d->mouse_mode == SPICE_MOUSE_MODE_SERVER &&
> + d->mouse_guest_x != -1 && d->mouse_guest_y != -1 &&
> !d->show_cursor) {
> GdkPixbuf *image = d->mouse_pixbuf;
> if (image != NULL) {
> diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
> index cdcff03..588d028 100644
> --- a/gtk/spice-widget.c
> +++ b/gtk/spice-widget.c
> @@ -1849,13 +1849,14 @@ static void update_mouse_mode(SpiceChannel *channel, gpointer data)
> break;
> case SPICE_MOUSE_MODE_SERVER:
> try_mouse_grab(display);
> + d->mouse_guest_x = -1;
> + d->mouse_guest_y = -1;
> break;
> default:
> g_warn_if_reached();
> }
>
> update_mouse_pointer(display);
> - cursor_invalidate(display);
> }
>
> static void update_area(SpiceDisplay *display,
> --
> 1.7.11.7
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20121113/39888a21/attachment.pgp>
More information about the Spice-devel
mailing list