VirtualBox

Ticket #2306 (closed defect: fixed)

Opened 1 year ago

Last modified 8 months ago

where mouse is drawn on guest does not match mouse coordinates -> fixed in SVN

Reported by: stephanecharette Assigned to:
Priority: major Component: guest additions
Version: VirtualBox 2.1.4 Keywords:
Cc: Guest type: Linux
Host type: Linux

Description

I've observed this on Debian Etch 64-bit guest running on Ubuntu 8.04 64-bit host; VirtualBox 2.0.2.

With *some* guest screen resolutions (not all) the mouse seems to be drawn in the wrong location. Near the top of the screen, the mouse is OK. But as the mouse progresses through the Y axis towards the bottom of the screen, an offset appears between the drawn mouse and where X think the mouse is located. Near the bottom of the screen, I've seen a difference of maybe 100 pixels between the drawn mouse and where X thinks the mouse is located.

This is very obvious when dragging a window towards the bottom of the screen, or trying to click on a button located near the bottom of the screen. End result is you must click anywhere between 50 to 100 pixels "higher" than where you actually want to click.

Example resolution (/etc/X11/xorg.conf) where this problem does not happen: 1280x1024

Example resolutions where this problem occurs: 1400x940, 1152x864, 1200x950

Workaround: if I disable mouse integration then the mouse works fine.

Change History

2008-09-24 11:21:35 changed by michael

Could you please attach your guest xorg.conf file? I am wondering whether you have fixed the virtual Y resolution to 1024 or something similar. Of course, this should not cause the problem you are seeing, but knowing might help us fix it.

2008-09-24 17:44:23 changed by stephanecharette

I'm trying to use resolutions where Y is 950. So the VB window fits nicely in my screen without the use of scroll bars. My host resolution is 1050 pixels high.

The relevant parts of xorg.conf would be:

Section "Device"

Identifier "Generic Video Card"

Driver "vboxvideo"

BusID "PCI:0:2:0"

EndSection?

Section "Screen"

Identifier "Default Screen" Device "Generic Video Card" Monitor "Generic Monitor" DefaultDepth? 24 SubSection? "Display"

Depth 24 Modes "1400x940" "1200x940" "1280x854" "1024x768" "800x600" "640x480"

EndSubSection?

EndSection?

All of this wouldn't matter if the dynamic desktop resizing function worked like it does when the guest is Windows and Ubuntu. But for some reason it doesn't work with Debian.

2008-09-24 18:00:27 changed by michael

Reproduced it on a 32bit Etch guest, but only when I add "1280x1024" to the list of resolutions that you gave. Dynamic resizing doesn't work on Etch because it relies on features added in Xorg server 1.3 (RandR 1.2).

2008-10-24 12:19:00 changed by stephanecharette

Update: This is still happening for me with VirtualBox 2.0.4.

2008-11-07 20:00:30 changed by stephanecharette

Bump. Any news on this?

2008-11-07 20:39:20 changed by frank

  • version changed from VirtualBox 2.0.2 to VirtualBox 2.0.4.

2008-11-26 22:33:27 changed by stephanecharette

Problem still exists in VirtualBox 2.0.6.

2008-12-13 22:40:31 changed by Samus_Aran

The mouse is always out of alignment when using low resolution SDL fullscreen modes in the guest, such as running "tuxpaint --fullscreen".

2008-12-13 22:41:29 changed by Samus_Aran

I should mention I am on the latest (2.0.6) with an Ubuntu 8.10 guest on an Ubuntu 8.04 host.

2008-12-17 20:17:38 changed by stephanecharette

Problem still exists in VirtualBox 2.1 released today.

My xorg.conf file contains:

SubSection? "Display"

Depth 24 Modes "1650x940" "1280x1024" "1024x768" "800x600" "640x480"

EndSubSection?

I run at 1650x940 simply because it fills up the right amount of my host's screen that I can still access the top bar. But due to this mouse issue, I must run with mouse integration disabled.

2008-12-18 10:29:58 changed by frank

Does it change anything if you change the resolution to something where the width is divisible by 8?

2008-12-18 12:35:18 changed by stephanecharette

I modified my /etc/X11/xorg.conf file (relevant portion posted in my comment above) to try the following resolutions:

1650x940 (neither width nor height are multiples of 8) 1648x940 (width is multiple of 8) 1650x936 (height is multiple of 8) 1648x936 (both width and height are multiple of 8)

Same incorect behaviour with all 4 of these resoltuions. The mouse is in sync at the top of the screen, but as you move down, the mouse is less and less in sync. The mouse is drawn higher up than where the "hidden true" mouse is located.

2009-02-17 18:07:10 changed by michael

  • version changed from VirtualBox 2.0.4 to VirtualBox 2.1.4.

I have investigated this a bit more, and I have discovered the reason for the wrong mouse position, but have no idea how to fix it. The reason is that when we report the absolute position of the pointer to the X server, the server interprets this as an absolute position on the virtual desktop. If the virtual desktop is larger than the actual guest resolution, then the position at which the pointer is reported will be scaled, as the host reports a position relative to the physical resolution (was that understandable?) However, I can't find any way for the mouse driver to access this information (the graphics driver can, obviously, but the two don't communicate). The workaround is to make sure that the virtual desktop is no larger than the guest resolution.

2009-02-23 16:14:10 changed by michael

  • summary changed from where mouse is drawn on guest does not match mouse coordinates to where mouse is drawn on guest does not match mouse coordinates -> fixed in SVN.

I've implemented a better work-around for this situation. Now, if the virtual desktop in the guest is larger than the physical one we hide the host mouse pointer and let the guest draw its own pointer in software inside the VM. The guest will always draw the pointer where it thinks it ought to be. A slightly ugly solution, but still much better than before. Unfortunately this won't make it into the 2.1 series though.

2009-02-23 18:49:27 changed by stephanecharette

Thank you for the update, Michael. I've worked around this for now by choosing different resolutions.

2009-04-08 14:24:51 changed by frank

  • status changed from new to closed.
  • resolution set to fixed.

© 2009 Sun Microsystems, Inc.
ContactPrivacy policy