diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2014-03-13 14:21:59 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2014-03-14 22:33:16 +0100 |
commit | 2cb753503a04fdb79ba353e2a5692258132cc99c (patch) | |
tree | d842e230a50112e4c7a8555102e6250d076cbbee | |
parent | 524ee218ccd11bbb81e38dbc1b1bc35a0a58c9c0 (diff) |
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@redhat.com>
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
-rw-r--r-- | gtk/spice-widget.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c index 504a0b5..0e4a0de 100644 --- a/gtk/spice-widget.c +++ b/gtk/spice-widget.c @@ -2583,8 +2583,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]; |