wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

getwinrect.c (348B)


      1 /* Copyright ©2007-2010 Kris Maglione <maglione.k at Gmail>
      2  * See LICENSE file for license details.
      3  */
      4 #include "../x11.h"
      5 
      6 Rectangle
      7 getwinrect(Window *w) {
      8 	XWindowAttributes wa;
      9 	Point p;
     10 
     11 	if(!XGetWindowAttributes(display, w->xid, &wa))
     12 		return ZR;
     13 	p = translate(w, &scr.root, ZP);
     14 	return rectaddpt(Rect(0, 0, wa.width, wa.height), p);
     15 }