[Spice-devel] [PATCH spice-gtk] Fix cursor hide not hiding in some cases
Christophe Fergeau
cfergeau at redhat.com
Tue Apr 10 08:31:58 PDT 2012
ACK
On Tue, Apr 10, 2012 at 01:26:36PM +0200, Marc-André Lureau wrote:
> cursor_set() didn't un-hide correctly by setting "show_cursor" to
> NULL.
This is in client-mode that this wasn't done, right? ACK otherwise
Christophe
>
> The code is simplified a bit in server mode case, where the new cursor
> will be invalidated and shown during cursor move only, instead of
> twice (checked no regression with dual-head server mode)
> ---
> gtk/spice-widget.c | 18 +++++++++++-------
> 1 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
> index ff361bf..30e58dc 100644
> --- a/gtk/spice-widget.c
> +++ b/gtk/spice-widget.c
> @@ -1645,17 +1645,21 @@ static void cursor_set(SpiceCursorChannel *channel,
> } else
> g_warn_if_reached();
>
> - if (d->show_cursor && d->mouse_mode == SPICE_MOUSE_MODE_SERVER) {
> - /* keep hidden cursor, will be shown in cursor_move() */
> + if (d->show_cursor) {
> + /* unhide */
> gdk_cursor_unref(d->show_cursor);
> - d->show_cursor = cursor;
> - } else {
> - gdk_cursor_unref(d->mouse_cursor);
> - d->mouse_cursor = cursor;
> + d->show_cursor = NULL;
> + if (d->mouse_mode == SPICE_MOUSE_MODE_SERVER) {
> + /* keep a hidden cursor, will be shown in cursor_move() */
> + d->show_cursor = cursor;
> + return;
> + }
> }
>
> - update_mouse_pointer(display);
> + gdk_cursor_unref(d->mouse_cursor);
> + d->mouse_cursor = cursor;
>
> + update_mouse_pointer(display);
> cursor_invalidate(display);
> }
>
> --
> 1.7.7.6
>
> _______________________________________________
> 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/20120410/eff13440/attachment-0001.pgp>
More information about the Spice-devel
mailing list