From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIIdA-00083p-DL for qemu-devel@nongnu.org; Wed, 20 Mar 2013 09:00:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIId5-0007ZS-Mf for qemu-devel@nongnu.org; Wed, 20 Mar 2013 09:00:36 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:43232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIId5-0007ZH-5B for qemu-devel@nongnu.org; Wed, 20 Mar 2013 09:00:31 -0400 Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Mar 2013 22:58:23 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id C5188357804A for ; Thu, 21 Mar 2013 00:00:11 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2KCxY2S7471508 for ; Wed, 20 Mar 2013 23:59:34 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2KCxbbQ011398 for ; Wed, 20 Mar 2013 23:59:38 +1100 From: Anthony Liguori In-Reply-To: <1363772625-9182-22-git-send-email-kraxel@redhat.com> References: <1363772625-9182-1-git-send-email-kraxel@redhat.com> <1363772625-9182-22-git-send-email-kraxel@redhat.com> Date: Wed, 20 Mar 2013 07:59:08 -0500 Message-ID: <87fvzq6xcz.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 21/23] gtk: custom cursor support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , qemu-devel@nongnu.org Gerd Hoffmann writes: > Makes gtk ui play nicely with qxl (and vmware_svga) > as you can actually see your pointer now ;) > > Signed-off-by: Gerd Hoffmann > --- > ui/gtk.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/ui/gtk.c b/ui/gtk.c > index 7599ff4..512e974 100644 > --- a/ui/gtk.c > +++ b/ui/gtk.c > @@ -303,6 +303,29 @@ static void gd_refresh(DisplayChangeListener *dcl) > graphic_hw_update(dcl->con); > } > > +static void gd_mouse_set(DisplayChangeListener *dcl, > + int x, int y, int visible) > +{ > + /* should warp pointer to x, y here */ This is just a matter of doing: gdk_window_get_root_coords(window, x, y, &x_root, &y_root); gdk_display_warp_pointer(display, screen, x_root, y_root); > +} > + > +static void gd_cursor_define(DisplayChangeListener *dcl, > + QEMUCursor *c) > +{ > + GtkDisplayState *s = container_of(dcl, GtkDisplayState, dcl); > + GdkPixbuf *pixbuf; > + GdkCursor *cursor; > + > + pixbuf = gdk_pixbuf_new_from_data((guchar *)(c->data), > + GDK_COLORSPACE_RGB, true, 8, > + c->width, c->height, c->width * 4, > + NULL, NULL); > + cursor = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), You should get the display from the drawing_area widget. > + pixbuf, c->hot_x, c->hot_y); > + gdk_window_set_cursor(s->drawing_area->window, cursor); > + g_object_unref(pixbuf); You should also dereference the cursor here. Regards, Anthony Liguori