Let the USB tablet reach the far bottom and right pixels

(Samuel Thibault)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4036 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
aurel32 2008-03-10 19:34:27 +00:00
parent c6c99c3f17
commit b94ed5772e
4 changed files with 6 additions and 6 deletions

View File

@ -40,7 +40,7 @@
#define cgrect(nsrect) (*(CGRect *)&(nsrect)) #define cgrect(nsrect) (*(CGRect *)&(nsrect))
#define COCOA_MOUSE_EVENT \ #define COCOA_MOUSE_EVENT \
if (isTabletEnabled) { \ 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); \
} else if (isMouseGrabed) { \ } else if (isMouseGrabed) { \
kbd_mouse_event((int)[event deltaX], (int)[event deltaY], 0, buttons); \ kbd_mouse_event((int)[event deltaX], (int)[event deltaY], 0, buttons); \
} else { \ } else { \

4
sdl.c
View File

@ -312,8 +312,8 @@ static void sdl_send_mouse_event(int dz)
} }
SDL_GetMouseState(&dx, &dy); SDL_GetMouseState(&dx, &dy);
dx = dx * 0x7FFF / width; dx = dx * 0x7FFF / (width - 1);
dy = dy * 0x7FFF / height; dy = dy * 0x7FFF / (height - 1);
} else if (absolute_enabled) { } else if (absolute_enabled) {
sdl_show_cursor(); sdl_show_cursor();
absolute_enabled = 0; absolute_enabled = 0;

2
vl.c
View File

@ -588,7 +588,7 @@ void kbd_mouse_event(int dx, int dy, int dz, int buttons_state)
if (qemu_put_mouse_event_current->qemu_put_mouse_event_absolute) if (qemu_put_mouse_event_current->qemu_put_mouse_event_absolute)
width = 0x7fff; width = 0x7fff;
else else
width = graphic_width; width = graphic_width - 1;
mouse_event(mouse_event_opaque, mouse_event(mouse_event_opaque,
width - dy, dx, dz, buttons_state); width - dy, dx, dz, buttons_state);
} else } else

4
vnc.c
View File

@ -879,8 +879,8 @@ static void pointer_event(VncState *vs, int button_mask, int x, int y)
dz = 1; dz = 1;
if (vs->absolute) { if (vs->absolute) {
kbd_mouse_event(x * 0x7FFF / vs->ds->width, kbd_mouse_event(x * 0x7FFF / (vs->ds->width - 1),
y * 0x7FFF / vs->ds->height, y * 0x7FFF / (vs->ds->height - 1),
dz, buttons); dz, buttons);
} else if (vs->has_pointer_type_change) { } else if (vs->has_pointer_type_change) {
x -= 0x7FFF; x -= 0x7FFF;