Commit b94ed5772eb31e8fad4b823351e8152839bf722a

Authored by aurel32
1 parent c6c99c3f

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
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 #define cgrect(nsrect) (*(CGRect *)&(nsrect)) 40 #define cgrect(nsrect) (*(CGRect *)&(nsrect))
41 #define COCOA_MOUSE_EVENT \ 41 #define COCOA_MOUSE_EVENT \
42 if (isTabletEnabled) { \ 42 if (isTabletEnabled) { \
43 - kbd_mouse_event((int)(p.x * 0x7FFF / screen.width), (int)((screen.height - p.y) * 0x7FFF / screen.height), 0, buttons); \ 43 + kbd_mouse_event((int)(p.x * 0x7FFF / (screen.width - 1)), (int)((screen.height - p.y) * 0x7FFF / (screen.height - 1)), 0, buttons); \
44 } else if (isMouseGrabed) { \ 44 } else if (isMouseGrabed) { \
45 kbd_mouse_event((int)[event deltaX], (int)[event deltaY], 0, buttons); \ 45 kbd_mouse_event((int)[event deltaX], (int)[event deltaY], 0, buttons); \
46 } else { \ 46 } else { \
@@ -312,8 +312,8 @@ static void sdl_send_mouse_event(int dz) @@ -312,8 +312,8 @@ static void sdl_send_mouse_event(int dz)
312 } 312 }
313 313
314 SDL_GetMouseState(&dx, &dy); 314 SDL_GetMouseState(&dx, &dy);
315 - dx = dx * 0x7FFF / width;  
316 - dy = dy * 0x7FFF / height; 315 + dx = dx * 0x7FFF / (width - 1);
  316 + dy = dy * 0x7FFF / (height - 1);
317 } else if (absolute_enabled) { 317 } else if (absolute_enabled) {
318 sdl_show_cursor(); 318 sdl_show_cursor();
319 absolute_enabled = 0; 319 absolute_enabled = 0;
@@ -588,7 +588,7 @@ void kbd_mouse_event(int dx, int dy, int dz, int buttons_state) @@ -588,7 +588,7 @@ void kbd_mouse_event(int dx, int dy, int dz, int buttons_state)
588 if (qemu_put_mouse_event_current->qemu_put_mouse_event_absolute) 588 if (qemu_put_mouse_event_current->qemu_put_mouse_event_absolute)
589 width = 0x7fff; 589 width = 0x7fff;
590 else 590 else
591 - width = graphic_width; 591 + width = graphic_width - 1;
592 mouse_event(mouse_event_opaque, 592 mouse_event(mouse_event_opaque,
593 width - dy, dx, dz, buttons_state); 593 width - dy, dx, dz, buttons_state);
594 } else 594 } else
@@ -879,8 +879,8 @@ static void pointer_event(VncState *vs, int button_mask, int x, int y) @@ -879,8 +879,8 @@ static void pointer_event(VncState *vs, int button_mask, int x, int y)
879 dz = 1; 879 dz = 1;
880 880
881 if (vs->absolute) { 881 if (vs->absolute) {
882 - kbd_mouse_event(x * 0x7FFF / vs->ds->width,  
883 - y * 0x7FFF / vs->ds->height, 882 + kbd_mouse_event(x * 0x7FFF / (vs->ds->width - 1),
  883 + y * 0x7FFF / (vs->ds->height - 1),
884 dz, buttons); 884 dz, buttons);
885 } else if (vs->has_pointer_type_change) { 885 } else if (vs->has_pointer_type_change) {
886 x -= 0x7FFF; 886 x -= 0x7FFF;