]> git.ipfire.org Git - thirdparty/qemu.git/commit
ui/gtk: use widget size for cursor motion event
authorErico Nunes <ernunes@redhat.com>
Mon, 20 Mar 2023 16:08:55 +0000 (17:08 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 31 May 2023 06:42:36 +0000 (09:42 +0300)
commit7fd387715b501d2a0c1b6032ea526c20bde0fdb5
tree3ea49383127a7f47663e11b13126e544eeb4102b
parent76b7002ec724b5f8dc2cf3fbb6ffb458baadd836
ui/gtk: use widget size for cursor motion event

The gd_motion_event size has some calculations for the cursor position,
which also take into account things like different size of the
framebuffer compared to the window size.
The use of window size makes things more difficult though, as at least
in the case of Wayland includes the size of ui elements like a menu bar
at the top of the window. This leads to a wrong position calculation by
a few pixels.
Fix it by using the size of the widget, which already returns the size
of the actual space to render the framebuffer.

Signed-off-by: Erico Nunes <ernunes@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
Message-Id: <20230320160856.364319-1-ernunes@redhat.com>
(cherry picked from commit 2f31663ed4b5631b5e1c79f5cdd6463e55410eb8)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
ui/gtk.c