OS.XSetRegion (data.display, handle, data.damageRgn);
if (data.damageRgn == 0) { OS.XSetClipMask (data.display, handle, OS.None); } else { OS.XSetRegion (data.display, handle, data.damageRgn); }
void setClipping(int clipRgn) {	if (clipRgn == 0) {		if (data.clipRgn != 0) {			OS.XDestroyRegion (data.clipRgn);			data.clipRgn = 0;		} else {			return;		}		if (data.damageRgn == 0) {			OS.XSetClipMask (data.display, handle, OS.None);		} else {			OS.XSetRegion (data.display, handle, data.damageRgn);					}	} else {		if (data.clipRgn == 0) data.clipRgn = OS.XCreateRegion ();		OS.XSubtractRegion (data.clipRgn, data.clipRgn, data.clipRgn);		OS.XUnionRegion (clipRgn, data.clipRgn, data.clipRgn);		int clipping = clipRgn;		if (data.damageRgn != 0) {			clipping = OS.XCreateRegion();			OS.XUnionRegion(clipping, clipRgn, clipping);			OS.XIntersectRegion(clipping, data.damageRgn, clipping);		}		OS.XSetRegion (data.display, handle, clipping);		if (clipping != clipRgn) OS.XDestroyRegion(clipping);	}	int /*long*/ cairo = data.cairo;	if (cairo != 0) {		setCairoClip(cairo, clipRgn);	}}