mouse pointer offset with gtk,gl=on

Bug #1592351 reported by Jirislaby
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

When I turn gl=on for -display gtk, some Y offset is added to the mouse pointer coordinates. That is, when I click on an icon, an icon _above_ the one I clicked triggers.

Using xev, it seems to be offset of 10-12 pixels.

It happens with all ps/2 mouse, -usbdevice mouse and -usbdevice tablet.

Without gl=on, the pointer is precise.

I have these qemu versions:
qemu-2.6.0-470.2.x86_64
qemu-ipxe-1.0.0-470.2.noarch
qemu-ksm-2.6.0-470.2.x86_64
qemu-kvm-2.6.0-470.2.x86_64
qemu-ovmf-x86_64-2015+git1462940744.321151f-2.1.noarch
qemu-ppc-2.6.0-470.2.x86_64
qemu-seabios-1.9.1-470.2.noarch
qemu-sgabios-8-470.2.noarch
qemu-tools-2.6.0-470.2.x86_64
qemu-vgabios-1.9.1-470.2.noarch
qemu-x86-2.6.0-470.2.x86_64

Revision history for this message
Jirislaby (jirislaby) wrote :

The same happens with qemu from git, commit a28aae041aa76a779df6467a7fe68b9e8a8b2c0a.

Revision history for this message
Jirislaby (jirislaby) wrote :

This is because height from gdk_drawable_get_size() in gd_motion_event() includes menu or whatever:

gl=off:
gd_motion_event: fbw= 640 fbh= 480 ww= 640 wh= 480 mx= 0 my= 0 x= 576 y= 3

gl=on:
gd_motion_event: fbw= 640 fbh= 480 ww= 640 wh= 506 mx= 0 my= 13 x= 571 y= 471

Revision history for this message
Dr. David Alan Gilbert (dgilbert-h) wrote :

Yeh I saw this behaviour as well.

Changed in qemu:
status: New → Confirmed
Revision history for this message
Jirislaby (jirislaby) wrote :

s->menu_bar's height is really 26px (506-480)
both s->notebook's and vc->tab_item's height is 506 px (the same as vc->gfx.drawing_area).

I cannot figure out why...

Revision history for this message
Jirislaby (jirislaby) wrote :

Ok, should we use
  gtk_widget_get_allocated_height and gtk_widget_get_allocated_width
instead of
  gdk_drawable_get_size
?

Revision history for this message
Jirislaby (jirislaby) wrote :

That works for scale = 1. Given scale is set only in draw (2d) and not in render (3d), it never worked with other scales. Apart from that, the code is full of bugs.

I could make it work with the attached diff modulo the fprintfs, basically. However I am not going to invest more time into that, as it has to be audited and fixed by someone who actually understands the code.

Revision history for this message
undefined (1j9rwias) wrote :

Mouse still doesn't work properly with 2.9.0 and Ubuntu 17.04 guest
-smp 2 -enable-kvm -vga virtio -display gtk,gl=on -m 2048 -cdrom ubuntu-17.04-desktop-amd64.iso

Revision history for this message
undefined (1j9rwias) wrote :

mouse works better with debug & fix patch

Revision history for this message
tinywrkb (tinywrkb) wrote :

seems to be fixed with f1aba960cc40ab65fa88c8678883bd2201708c55 : https://git.qemu.org/?p=qemu.git;a=commit;h=f1aba960cc40ab65fa88c8678883bd2201708c55

anyone else can confirm, i have another issue affecting scaling with my setup.

Revision history for this message
Thomas Huth (th-huth) wrote :

FWIW: Commit f1aba960cc40 has been released with v3.1.0.

Changed in qemu:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.