wmii

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

warppointer.c (527B)


      1 /* Copyright ©2007-2010 Kris Maglione <maglione.k at Gmail>
      2  * See LICENSE file for license details.
      3  */
      4 #include "../x11.h"
      5 
      6 void
      7 warppointer(Point pt) {
      8 	/* Nasty kludge for xephyr, xnest. */
      9 	static int havereal = -1;
     10 	static char* real;
     11 
     12 	if(havereal == -1) {
     13 		real = getenv("REALDISPLAY");
     14 		havereal = real != nil;
     15 	}
     16 	if(havereal)
     17 		system(sxprint("DISPLAY=%s wiwarp %d %d", real, pt.x, pt.y));
     18 
     19 	XWarpPointer(display,
     20 		/* src, dest w */ None, scr.root.xid,
     21 		/* src_rect */	0, 0, 0, 0,
     22 		/* target */	pt.x, pt.y);
     23 }