mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
ui/gtk: fix cursor moved to left corner
Do not attempt to move the pointer if the widget is not yet realized.
The mouse cursor is placed to the corner of the screen, on X11 at least,
as x_root and y_root are then miscalculated. (this is not reproducible
on Wayland, because Gtk doesn't implement device warping there)
This also fixes the following warning at start:
qemu: Gdk: gdk_window_get_root_coords: assertion 'GDK_IS_WINDOW (window)' failed
Fixes: 6effaa16ac
("ui: set cursor position upon listener
registration")
Reported-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Bernhard Beschow <shentey@gmail.com>
Message-Id: <20230320132624.1612464-1-marcandre.lureau@redhat.com>
This commit is contained in:
parent
74bc00c6b9
commit
281a77df28
1 changed files with 2 additions and 1 deletions
3
ui/gtk.c
3
ui/gtk.c
|
@ -450,7 +450,8 @@ static void gd_mouse_set(DisplayChangeListener *dcl,
|
|||
GdkDisplay *dpy;
|
||||
gint x_root, y_root;
|
||||
|
||||
if (qemu_input_is_absolute()) {
|
||||
if (!gtk_widget_get_realized(vc->gfx.drawing_area) ||
|
||||
qemu_input_is_absolute()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue