Opened 14 years ago

Closed 13 years ago

#7566 closed defect (fixed)

Guest mouse is offset from host mouse by -1,-1 when GA mouse capture active -> fixed as of 2 Aug 2011

Reported by: Mark Cranness Owned by:
Component: guest additions Version: VirtualBox 3.2.8
Keywords: mouse pointer position offset Cc:
Guest type: other Host type: other


With GA Mouse Integration enabled, the guest mouse pointer position is offset from the correct position.

(This is a follow up to "Windows XP Taskbar on Autohide no longer pops up" -

The mouse pointer displays at the host coordinates, but the pointer position seen by the guest is offset 1 left and 1 up from the host pointer position (the guest reads one lower in both x and y coordinates).

So on a 1280x1024 host display, guest full-screen, the guest mouse pointer goes from Y=0 to only 1022, while the host goes from 0 to 1023. On the guest, the bottom most position of Y=1023 CANNOT be reached. (The same problem also applies non-fullscreen, windowed mode.)

When the host reads Y=0, or Y=1, the guest reads Y=0. When the host reads X, the guest reads X-1.

If you use a paint program on the guest, you can see this difference. Pixels drawn appear one up and one left of where they are expected to appear based on the mouse pointer position, as compared to the same program running on the host.

This program (Windows) shows mouse pointer position as the mouse is moved (I run it on host and guest): (I can provide source if required.)

Only happens when Mouse Integration is enabled.

Host: Windows XP, VB 3.2.8r64453, Guest: Windows XP, GA 3.2.8r64453 (and earlier versions)

Change History (4)

comment:1 by Mike, 13 years ago

This bug is also present in Win 7 guests. It prevents the Windows 7 gesture for snapping a window to the right half of the screen.

comment:2 by Michael Thayer, 13 years ago

Summary: Guest mouse is offset from host mouse by -1,-1 when GA mouse capture activeGuest mouse is offset from host mouse by -1,-1 when GA mouse capture active -> fixed as of 2 Aug 2011

The problem turned out to be that we were sending the position of the upper left corner of the pixel under the mouse pointer to the guest. Because Windows expects the cursor position as a value between 0 and 65535 we could not return the position precisely though, and due to conversion errors Windows often (always?) ended up matching the wrong pixel to the pointer position. Fixed by returning the position of the centre of the pixel instead of the corner.

comment:3 by Michael Thayer, 13 years ago

Tickets #9169 and #9321 have been marked duplicates of this one.

comment:4 by Frank Mehnert, 13 years ago

Resolution: fixed
Status: newclosed

Fixed in VBox 4.1.2.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use