xgrabpointer

Locking mouse pointer using xGrabPointer in Linux

允我心安 提交于 2019-12-24 06:45:08
问题 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 .

X11: How do I REALLY grab the mouse pointer?

廉价感情. 提交于 2019-12-18 13:12:03
问题 I've implemented a horizontal splitter widget in Xlib. I'm trying to grab the mouse when the user clicks & drags on the splitter bar (so that the user can dynamically move the split & thus resize the windows on either side of the splitter bar). I've used XGrabPointer() after receiving a left click, in hopes that all future mouse motion (dragging) will be diverted to the splitter window until the left button is released. Unfortuntately, it doesn't seem to work like that. If the user drags too