# HG changeset patch # User John Tsiombikas # Date 1454321909 -7200 # Node ID b832d3b3ed98baf98074fe831491f4a6cb06eb53 # Parent 9b560415bad46cb3c35b88724fa6d94f552574a2 taking offset into account in get_window_shape diff -r 9b560415bad4 -r b832d3b3ed98 src/main.c --- a/src/main.c Tue Nov 03 04:08:32 2015 +0200 +++ b/src/main.c Mon Feb 01 12:18:29 2016 +0200 @@ -333,20 +333,24 @@ int bx, by, cx, cy; unsigned int bw, bh, cw, ch; int kind; - int w, h; + int xoffs, yoffs, w, h; XRectangle *rects; int i, rect_count, rect_order; XShapeQueryExtents(dpy, win, &buse, &bx, &by, &bw, &bh, &cuse, &cx, &cy, &cw, &ch); - if(cuse) { + if(buse) { + w = bw; + h = bh; + xoffs = bx; + yoffs = by; + kind = ShapeBounding; + } else if(cuse) { w = cw; h = ch; + xoffs = cx; + yoffs = cy; kind = ShapeClip; - } else if(buse) { - w = bw; - h = bh; - kind = ShapeBounding; } else { fprintf(stderr, "XShapeQueryExtents returned no extents\n"); return -1; @@ -365,7 +369,7 @@ } for(i=0; i