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

Christophe Fergeau cfergeau at redhat.com
Thu Apr 9 06:37:49 PDT 2015


ACK.
Do we need to do the same in invalidate() ?

Christophe

On Tue, Apr 07, 2015 at 06:26:31PM +0200, Pavel Grunt wrote:
> 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
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150409/16ab2e0f/attachment.sig>


More information about the Spice-devel mailing list