[Spice-devel] [PATCH spice-gtk] spice-widget: Do not invalidate cursor when display is not ready

Pavel Grunt pgrunt at redhat.com
Tue Apr 7 09:26:31 PDT 2015


spice_display_get_scaling() gives wrong x, y coordinates and scaling
when the display is not ready. The wrong values cause runtime
warnings when disabling a virt-viewer's window:
Gtk-CRITICAL **: gtk_widget_queue_draw_area: assertion 'width >= 0' failed
---
 gtk/spice-widget.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index f5e8aab..b9c4972 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -2347,6 +2347,9 @@ static void cursor_invalidate(SpiceDisplay *display)
     if (d->mouse_pixbuf == NULL)
         return;
 
+    if (!d->ready || !d->monitor_ready)
+        return;
+
     spice_display_get_scaling(display, &s, &x, &y, NULL, NULL);
 
     gtk_widget_queue_draw_area(GTK_WIDGET(display),
-- 
2.3.4



More information about the Spice-devel mailing list