monitor command mouse_button 1 moves mouse

Bug #752476 reported by Bernhard M. Wiedemann on 2011-04-06
This bug affects 3 people
Affects Status Importance Assigned to Milestone

Bug Description

via the qemu -monitor interface, it is possible to move and click the mouse using
mouse_move 20000 10000
mouse_button 1
but the mouse_button command always moves the mouse to (0,0) making it rather unusable to (auto-)trigger any widgets in the VM from the outside.

Would be nice to have this available for my qemu/kvm based os-autoinst testing framework.

Brad Hards (bradh) wrote :

Hi. Thanks for reporting this issue.

I'm able to (partly) reproduce this, but it might help if I could understand your configuration a bit more.

Does mouse movement work for you using the normal interface (SDL or VNC)?

Do you have the pointer device configured in an absolute mode (e.g. something like a USB tablet device)?

Brad Hards (bradh) wrote :

Can you try the attached patch?


I build a kvm-0.14 with this patch on top and it finally allowed me to issue a click using mouse_button via monitor.
Great! Thanks!

For my automated tests I use kvm like this:
/usr/bin/qemu-kvm -m 1024 -net user -monitor tcp:,server,nowait -net nic,model=virtio,macaddr=52:54:00:12:34:56 -serial file:serial0 -drive file=raid/l1,if=virtio,boot=on -boot dc -cdrom /opensuse/factory/iso/openSUSE-NET-i586-Build0046-Media.iso -vnc :99 -k de -cpu qemu32 -usb -usbdevice tablet

VNC is only there for manual interaction with automated testruns. All automation goes over the monitor interface.
Moving+Clicking over VNC/SDL of course always worked.

However, I found that even without -usbdevice tablet it will use absolute mouse with openSUSE. It mentions VMMOUSE in /var/log/Xorg.0.log

I also noticed that when using VNC to move the mouse, the next mouse_button command will move to the last position set with mouse_move - not a problem for my needs, though.

SDL on a headless server is not possible because of Bug #691424

Btw: test results can be seen on

Ludwig Nussel (l-n) wrote :

Bard, are you going to submit the patch for inclusion in qemu?

Ludwig Nussel (l-n) wrote :

Ah, there was a discussion where a better solution was supposed to be found. Maybe a new try is needed with the argumentation that it doesn't make the current code worse at all:

Andreas Färber (afaerber) wrote :

Apart from the patch missing a Signed-off-by, I have doubts whether reusing the coordinates from the last monitor command is generally correct. It should rather be the current coordinates, whether set by monitor or via VNC/SDL, I guess.

Paolo Bonzini (bonzini) wrote :

I think the right fix would be to remember the last position in ui/input.c, and use a new function kbd_mouse_button_event. mouse_move, followed by moving the mouse in the UI, followed by mouse_button 5 minutes later should not remember the position of the first mouse_move.

Also, mouse_move should call dpy_mouse_set.

Thomas Huth (th-huth) wrote :

Triaging old bug tickets ... can you somehow still reproduce this problem with the latest version of QEMU (currently v2.9), or could we close this ticket nowadays?

Changed in qemu:
status: New → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for QEMU because there has been no activity for 60 days.]

Changed in qemu:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers