From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIMa8-00064V-MN for qemu-devel@nongnu.org; Wed, 20 Mar 2013 13:13:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIMa7-000200-DF for qemu-devel@nongnu.org; Wed, 20 Mar 2013 13:13:44 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:60933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIMa6-0001zj-Rw for qemu-devel@nongnu.org; Wed, 20 Mar 2013 13:13:43 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 21 Mar 2013 03:06:41 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id F27852CE804C for ; Thu, 21 Mar 2013 04:13:33 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2KH0Udk57671786 for ; Thu, 21 Mar 2013 04:00:31 +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 r2KHDWai016402 for ; Thu, 21 Mar 2013 04:13:32 +1100 From: Anthony Liguori In-Reply-To: <5149D27E.2010505@redhat.com> References: <1363772625-9182-1-git-send-email-kraxel@redhat.com> <1363772625-9182-22-git-send-email-kraxel@redhat.com> <87fvzq6xcz.fsf@codemonkey.ws> <5149D27E.2010505@redhat.com> Date: Wed, 20 Mar 2013 12:13:23 -0500 Message-ID: <87ehfa3sgc.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 Cc: qemu-devel@nongnu.org Gerd Hoffmann writes: >>> +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); > > Thanks. > >>> + cursor = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), >> >> You should get the display from the drawing_area widget. > > Yea, couldn't find the function which does this though. gtk_widget_get_display(s->drawing_area) for both GTK2/GTK3. I don't think this will play all that nicely with GTK3 and multiple input devices but I can't think of a better way. The notion of a guest initiated cursor warp doesn't really make sense with multiple input devices I think. Regards, Anthony Liguori > >>> + 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. > > Will fix. > > cheers, > Gerd