+ gint x, y;
+ if (m->mask == None) return; /* no mask given */
+
+ /* set the clip region */
+ x = area->x + (area->width - m->mask->width) / 2;
+ y = area->y + (area->height - m->mask->height) / 2;
+
+ if (x < 0) x = 0;
+ if (y < 0) y = 0;
+
+ XSetClipMask(RrDisplay(m->mask->inst), RrColorGC(m->color), m->mask->mask);
+ XSetClipOrigin(RrDisplay(m->mask->inst), RrColorGC(m->color), x, y);
+
+ /* fill in the clipped region */
+ XFillRectangle(RrDisplay(m->mask->inst), p, RrColorGC(m->color), x, y,
+ x + m->mask->width, y + m->mask->height);
+
+ /* unset the clip region */
+ XSetClipMask(RrDisplay(m->mask->inst), RrColorGC(m->color), None);
+ XSetClipOrigin(RrDisplay(m->mask->inst), RrColorGC(m->color), 0, 0);