Re: [Qemu-devel] [PATCH] Let the USB tablet reach the far bottom and right pixels
Hi, On Wed, 27 Feb 2008, Samuel Thibault wrote: 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 - 1.15 +++ cocoa.m 27 Feb 2008 14:42:02 - @@ -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. Ciao, Dscho
Re: [Qemu-devel] [PATCH] Let the USB tablet reach the far bottom and right pixels
Johannes Schindelin, le Wed 27 Feb 2008 15:35:01 +, 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 - 1.15 +++ cocoa.m 27 Feb 2008 14:42:02 - @@ -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
Re: [Qemu-devel] [PATCH] Let the USB tablet reach the far bottom and right pixels
Hi, On Wed, 27 Feb 2008, Samuel Thibault wrote: Johannes Schindelin, le Wed 27 Feb 2008 15:35:01 +, 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 - 1.15 +++ cocoa.m 27 Feb 2008 14:42:02 - @@ -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