All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ui/gtk: fix error message regression
@ 2023-03-17  7:58 marcandre.lureau
  0 siblings, 0 replies; only message in thread
From: marcandre.lureau @ 2023-03-17  7:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, Marc-André Lureau, Gerd Hoffmann

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Since commit 6effaa16 ("ui: set cursor position upon listener
registration") a new error message shows up when starting qemu with gtk
backend:
qemu: Gdk: gdk_window_get_root_coords: assertion 'GDK_IS_WINDOW (window)' failed

Like many display listener callbacks, skip code if the widget is not yet
realized.

Fixes: 6effaa16 ("ui: set cursor position upon listener registration")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/gtk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index 57ae32474c..f3105796f8 100644
--- a/ui/gtk.c
+++ b/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 (qemu_input_is_absolute() ||
+        !gtk_widget_get_realized(vc->gfx.drawing_area)) {
         return;
     }
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-17  7:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-17  7:58 [PATCH] ui/gtk: fix error message regression marcandre.lureau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.