[Spice-devel] [PATCH spice-gtk 1/2] SpiceDisplay: Don't try to scale mouse coordinates when we're not scaling

Marc-André Lureau mlureau at redhat.com
Mon Apr 2 12:59:58 PDT 2012


ack series

----- Mensaje original -----
> Often (when not resized by the user) even though scaling is enabled,
> we are
> not actually scaling. In this case it is not necessary to scale the
> mouse coordinates, and sometimes it is even harmful.
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  gtk/spice-widget.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
> index 0defb60..28e8a7d 100644
> --- a/gtk/spice-widget.c
> +++ b/gtk/spice-widget.c
> @@ -1155,7 +1155,7 @@ static gboolean motion_event(GtkWidget *widget,
> GdkEventMotion *motion)
>          return true;
>  
>      gdk_drawable_get_size(gtk_widget_get_window(widget), &ww, &wh);
> -    if (spicex_is_scaled(display)) {
> +    if (spicex_is_scaled(display) && (d->width != ww || d->height !=
> wh)) {
>          double sx, sy;
>          sx = (double)d->width / (double)ww;
>          sy = (double)d->height / (double)wh;
> --
> 1.7.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list