[Spice-devel] [PATCH spice-gtk v3 1/6] gtk: Use gdk_cursor_new_from_name
Victor Toso
victortoso at redhat.com
Mon Jan 23 11:57:06 UTC 2017
Hi,
On Mon, Jan 23, 2017 at 12:40:47PM +0100, Pavel Grunt wrote:
> On Mon, 2017-01-23 at 12:27 +0100, Victor Toso wrote:
> > > - return gdk_cursor_new(GDK_BLANK_CURSOR);
> > > + if (!gdk_window)
> > > + return NULL;
> >
> > We might want to warn before returning NULL
> >
> I did it intentionally (original code didn't warn). We only need the
> cursor when there is a display. So I think it is ok, otherwise we
> would have to make sure it would not be called without a display.
Right.
> I would prefer g_clear_object(&d->mouse_cursor) but still
> g_clear_object assigns NULL, it is not needed - we want to assign a
> new cursor
Well, it is assigned in the next line. If I need to check if it is NULL
before unref, I'd always use g_clear_object(), but that's just me - feel
free to ignore it :)
> >
> >
> > Acked-by: Victor Toso <victortoso at redhat.com>
> > (Tested on X11 with client/server mouse mode)
> >
> > > d->mouse_cursor = cursor;
> > >
> > > update_mouse_pointer(display);
> > > @@ -2596,7 +2604,7 @@ static void cursor_hide(SpiceCursorChannel
> > > *channel, gpointer data)
> > >
> > > cursor_invalidate(display);
> > > d->show_cursor = d->mouse_cursor;
> > > - d->mouse_cursor = get_blank_cursor();
> > > + d->mouse_cursor = spice_display_get_blank_cursor(display);
> > > update_mouse_pointer(display);
> > > }
> > >
> > > --
> > > 2.11.0
>
> Thanks,
> Pavel
>
>
> > >
> > > _______________________________________________
> > > 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: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170123/3b9f1771/attachment.sig>
More information about the Spice-devel
mailing list