From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUPMU-0001W8-Sv for qemu-devel@nongnu.org; Wed, 27 Feb 2008 11:42:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUPMT-0001TA-1e for qemu-devel@nongnu.org; Wed, 27 Feb 2008 11:42:30 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUPMS-0001Sy-Tn for qemu-devel@nongnu.org; Wed, 27 Feb 2008 11:42:28 -0500 Received: from smtp02.citrix.com ([66.165.176.63]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JUPMS-0007Vw-Ep for qemu-devel@nongnu.org; Wed, 27 Feb 2008 11:42:28 -0500 Date: Wed, 27 Feb 2008 16:41:39 +0000 From: Samuel Thibault Subject: Re: [Qemu-devel] [PATCH] Let the USB tablet reach the far bottom and right pixels Message-ID: <20080227164139.GG5839@implementation.uk.xensource.com> References: <20080227144555.GA10230@implementation.uk.xensource.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Johannes Schindelin Cc: qemu-devel@nongnu.org Johannes Schindelin, le Wed 27 Feb 2008 15:35:01 +0000, a écrit : > > Index: cocoa.m > > =================================================================== > > RCS file: /sources/qemu/qemu/cocoa.m,v > > retrieving revision 1.15 > > diff -u -p -r1.15 cocoa.m > > --- cocoa.m 22 Jan 2008 23:25:15 -0000 1.15 > > +++ cocoa.m 27 Feb 2008 14:42:02 -0000 > > @@ -40,7 +40,7 @@ > > #define cgrect(nsrect) (*(CGRect *)&(nsrect)) > > #define COCOA_MOUSE_EVENT \ > > if (isTabletEnabled) { \ > > - kbd_mouse_event((int)(p.x * 0x7FFF / screen.width), (int)((screen.height - p.y) * 0x7FFF / screen.height), 0, buttons); \ > > + kbd_mouse_event((int)(p.x * 0x7FFF / (screen.width - 1)), (int)((screen.height - p.y) * 0x7FFF / (screen.height - 1)), 0, buttons); \ > > Would it not be better to multiply with 0x8000 / screen.width? This > seems "more correct" to me. No, because then you would not reach 0x7FFF: (1023 * 0x8000) / 1024 -> 0x7fe0 And then the guest does not reach 1023 (tested on windows). Samuel