Locking mouse pointer using xGrabPointer in Linux
问题 I am using X11 to get mouse position when the mouse button is pressed in a application which runs on terminal without any window. Getting Mouse Position : Display *dpy; Window root, child; int rootX, rootY, winX, winY; unsigned int mask; dpy = XOpenDisplay(NULL); XQueryPointer(dpy,DefaultRootWindow(dpy),&root,&child, &rootX,&rootY,&winX,&winY,&mask); Now I want to use XGrabPointer() to lock the mouse so that it does not interact with objects(windows , icons and docks ) present on desktop .