VirtualBox

Ticket #7566 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

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

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

Description

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" -  http://www.virtualbox.org/ticket/6456.)

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):  http://www.filefront.com/17226592/PointerPositionRecorder.zip/ (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

comment:1 Changed 3 years ago by mbursill

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 Changed 3 years ago by michael

  • Summary changed from Guest mouse is offset from host mouse by -1,-1 when GA mouse capture active to Guest 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 Changed 3 years ago by michael

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

comment:4 Changed 3 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in VBox 4.1.2.

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use