Re: [PATCH spice-gtk] Fix spice_display_get_pixbuf() with offset area

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ACK

----- Original Message -----
> From: "Marc-André Lureau" <marcandre.lureau@xxxxxxxxx>
> To: spice-devel@xxxxxxxxxxxxxxxxxxxxx
> Sent: Thursday, March 13, 2014 8:23:55 AM
> Subject:  [PATCH spice-gtk] Fix spice_display_get_pixbuf() with	offset area
> 
> Fix screenshot of secondary displays, with an area position != (0,0).
> 
> This has never been working correctly since the surface display "area"
> was introducted in:
> 
> commit e3bb7b1cfd162fcb8943e9d582dab43eeec6ce41
> Author: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> Date:   Tue Jun 12 19:24:47 2012 +0200
> 
>     display: learn to restrict display to an area
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1029761
> ---
>  gtk/spice-widget.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
> index f5adf66..233f36c 100644
> --- a/gtk/spice-widget.c
> +++ b/gtk/spice-widget.c
> @@ -2585,8 +2585,9 @@ GdkPixbuf *spice_display_get_pixbuf(SpiceDisplay
> *display)
>      src = d->data;
>      dest = data;
>  
> -    for (y = d->area.y; y < d->area.height; ++y) {
> -        for (x = d->area.x; x < d->area.width; ++x) {
> +    src += d->area.y * d->stride + d->area.x * 4;
> +    for (y = 0; y < d->area.height; ++y) {
> +        for (x = 0; x < d->area.width; ++x) {
>            dest[0] = src[x * 4 + 2];
>            dest[1] = src[x * 4 + 1];
>            dest[2] = src[x * 4 + 0];
> --
> 1.8.5.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]