XIntersectRegion(3)
๐ XIntersectRegion(3) โ XLIB FUNCTIONS ๐
okay bestie, welcome to region arithmetic โ it's lowkey giving geometry group chat, and I'm obsessed. This page is all about the Xlib functions that intersect, union, subtract, xor, offset, and shrink regions. No cap, the facts are staying exactly as they are; I'm just making them iconic. ๐ซถโจ
โจ NAME โจ
XIntersectRegion, XUnionRegion, XUnionRectWithRegion, XSubtractRegion, XXorRegion, XOffsetRegion, XShrinkRegion โ region arithmetic ๐
๐ธ SYNTAX ๐ธ
Here's the exact contract, bestie โ copy it character for character, iykyk:
int XIntersectRegion(Region sra, Region srb, Region dr_return);
int XUnionRegion(Region sra, Region srb, Region dr_return);
int XUnionRectWithRegion(XRectangle *rectangle, Region src_region,
Region dest_region_return);
int XSubtractRegion(Region sra, Region srb, Region dr_return);
int XXorRegion(Region sra, Region srb, Region dr_return);
int XOffsetRegion(Region r, int dx, int dy);
int XShrinkRegion(Region r, int dx, int dy);
๐ ARGUMENTS ๐
dest_region_returnโ returns the destination region. It's the "where the result lands" bestie. ๐ซdr_returnโ returns the result of the computation. Your math output slot, fr fr. ๐งฎdx,dyโ specify the x and y coordinates, which define the amount you want to move or shrink the specified region. The coordinate duo ate. ๐ฏrโ specifies the region. Main character region energy, periodt. ๐rectangleโ specifies the rectangle. Literally the rectangle. ๐ชsra,srbโ specify the two regions with which you want to perform the computation. Two regions, one computation, highkey iconic. ๐src_regionโ specifies the source region to be used. The source region, the blueprint, the vibe. ๐ฆ
๐ฅ DESCRIPTION ๐ฅ
XIntersectRegionโ computes the intersection of two regions. It's the overlap, the "we both have this" moment. ๐XUnionRegionโ computes the union of two regions. Everything from both, holding hands. ๐ซถXUnionRectWithRegionโ updates the destination region from a union of the specified rectangle and the specified source region. Rectangle plus source region, combined, into the destination. โจXSubtractRegionโ subtractssrbfromsraand stores the results indr_return. Bye-bye,srbbits. ๐XXorRegionโ calculates the difference between the union and intersection of two regions. The "only one of you, not both" vibe check. ๐ฅXOffsetRegionโ moves the specified region by a specified amount. Scoot scoot, region. ๐ผXShrinkRegionโ reduces the specified region by a specified amount. Positive values shrink the size of the region, and negative values expand the region. So positive = smaller, negative = bigger โ don't mix that up, bestie. ๐ญ
๐ฅ SEE ALSO ๐ฅ
XCreateRegion(3)XDrawRectangle(3)XEmptyRegion(3)Xlib - C Language X Interface
Signed with sparkle: X Version 11, libX11 1.8.14, and the one and only XIntersectRegion(3) โ byeee, go slay those regions ๐โจ
๐ฆ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 ยท X11
- arch rolling: libx11 1.8.14-1 ยท MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms