qemu-devel
[Top][All Lists]
Advanced

[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: Samuel Thibault
Subject: Re: [Qemu-devel] [PATCH] Let the USB tablet reach the far bottom and right pixels
Date: Wed, 27 Feb 2008 16:41:39 +0000
User-agent: Mutt/1.5.12-2006-07-14

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]