[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Let the USB tablet reach the far bottom and rig
From: |
Johannes Schindelin |
Subject: |
Re: [Qemu-devel] [PATCH] Let the USB tablet reach the far bottom and right pixels |
Date: |
Wed, 27 Feb 2008 16:56:31 +0000 (GMT) |
User-agent: |
Alpine 1.00 (LSU 882 2007-12-20) |
Hi,
On Wed, 27 Feb 2008, Samuel Thibault wrote:
> 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).
Ah, but of course!
Thanks,
Dscho