[Spice-commits] gtk/spice-widget.c

Pavel Grunt pgrunt at kemper.freedesktop.org
Fri Apr 24 02:00:21 PDT 2015


 gtk/spice-widget.c |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit f36bbaba4bf2e7558f41384dfc6b09a6d519154d
Author: Pavel Grunt <pgrunt at redhat.com>
Date:   Tue Apr 7 18:03:27 2015 +0200

    spice-widget: Do not invalidate cursor when display is not ready
    
    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

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),


More information about the Spice-commits mailing list