From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFxkn-00063P-NF for qemu-devel@nongnu.org; Fri, 29 Apr 2011 20:09:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFxkm-0002o0-Nk for qemu-devel@nongnu.org; Fri, 29 Apr 2011 20:09:45 -0400 Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:50498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFxkm-0002nB-7z for qemu-devel@nongnu.org; Fri, 29 Apr 2011 20:09:44 -0400 From: Brad Hards Date: Sat, 30 Apr 2011 10:09:37 +1000 References: <1302248640-24913-1-git-send-email-bradh@frogmouth.net> <20110408133708.2a25946a@doriath> <4DB94581.5080407@redhat.com> In-Reply-To: <4DB94581.5080407@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104301009.37314.bradh@frogmouth.net> Subject: Re: [Qemu-devel] [PATCH] monitor: avoid moving cursor during "mouse_button" command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org On Thursday 28 April 2011 20:46:25 Gerd Hoffmann wrote: > I think it would be much better to keep track of the mouse position (and > button state while being at it) in input.c instead of monitor.c. > > Once this is in place it should be easy to add kbd_mouse_* functions > which update position or buttons only, which the monitor code can use > then to avoid the unwanted pointer warp. This turns out to be a bit more difficult than we discussed. The new functions work well for the monitor code side (not unexpected, since its essentially the same as the original code I proposed for monitor-only changes). The problem is that almost all input code (in absolute mode) keeps track of the position itself - monitor was the exception. So a sequence like the following: 1. Move cursor in SDL 2. Use mouse_move in monitor 3. Use mouse_button 2 in monitor 4. Click mouse in SDL works ok up to step 3, but step 4 causes the pointer to warp back to where it was at the end of step 1. So it looks like we'd have to modify all callers of kbd_mouse_event(), and the code paths are already a bit convoluted. As discussed on IRC, I'm a bit concerned about testing cocoa and spice. Thoughts? Brad