summaryrefslogtreecommitdiff
path: root/glamor/glamor_text.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-07-01 12:34:20 +0900
committerAdam Jackson <ajax@redhat.com>2016-07-15 12:59:43 -0400
commite8e36755abb17872d669b88d33ca9adc511029a0 (patch)
tree95f9140734659ad6a4bce45d2112b278a2a9a0d3 /glamor/glamor_text.c
parent32a9504c69183485b0b796fa3966cd1e39992365 (diff)
glamor: Translate solid text background region after clipping
Fixes incorrect clipping for redirected windows which don't happen to be located at the top left corner of the screen. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96742 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'glamor/glamor_text.c')
-rw-r--r--glamor/glamor_text.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/glamor/glamor_text.c b/glamor/glamor_text.c
index c305305f4..cf165cad8 100644
--- a/glamor/glamor_text.c
+++ b/glamor/glamor_text.c
@@ -446,16 +446,17 @@ glamor_image_text(DrawablePtr drawable, GCPtr gc,
glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y);
if (width >= 0) {
- box.x1 = off_x + drawable->x + x;
- box.x2 = off_x + drawable->x + x + width;
+ box.x1 = drawable->x + x;
+ box.x2 = drawable->x + x + width;
} else {
- box.x1 = off_x + drawable->x + x + width;
- box.x2 = off_x + drawable->x + x;
+ box.x1 = drawable->x + x + width;
+ box.x2 = drawable->x + x;
}
- box.y1 = off_y + drawable->y + y - gc->font->info.fontAscent;
- box.y2 = off_y + drawable->y + y + gc->font->info.fontDescent;
+ box.y1 = drawable->y + y - gc->font->info.fontAscent;
+ box.y2 = drawable->y + y + gc->font->info.fontDescent;
RegionInit(&region, &box, 1);
RegionIntersect(&region, &region, gc->pCompositeClip);
+ RegionTranslate(&region, off_x, off_y);
glamor_solid_boxes(pixmap, RegionRects(&region), RegionNumRects(&region), gc->bgPixel);
RegionUninit(&region);
}