|
|
@ -81,21 +81,20 @@ main(int argc, char **argv) { |
|
|
|
w = XCreateWindow(dpy, root, 0, 0, DisplayWidth(dpy, screen), DisplayHeight(dpy, screen), |
|
|
|
w = XCreateWindow(dpy, root, 0, 0, DisplayWidth(dpy, screen), DisplayHeight(dpy, screen), |
|
|
|
0, DefaultDepth(dpy, screen), CopyFromParent, |
|
|
|
0, DefaultDepth(dpy, screen), CopyFromParent, |
|
|
|
DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixel, &wa); |
|
|
|
DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixel, &wa); |
|
|
|
|
|
|
|
|
|
|
|
XAllocNamedColor(dpy, DefaultColormap(dpy, screen), "black", &black, &dummy); |
|
|
|
XAllocNamedColor(dpy, DefaultColormap(dpy, screen), "black", &black, &dummy); |
|
|
|
pmap = XCreateBitmapFromData(dpy, w, curs, 8, 8); |
|
|
|
pmap = XCreateBitmapFromData(dpy, w, curs, 8, 8); |
|
|
|
invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0); |
|
|
|
invisible = XCreatePixmapCursor(dpy, pmap, pmap, &black, &black, 0, 0); |
|
|
|
XDefineCursor(dpy, w, invisible); |
|
|
|
XDefineCursor(dpy, w, invisible); |
|
|
|
XMapRaised(dpy, w); |
|
|
|
XMapRaised(dpy, w); |
|
|
|
for(len = 1000; len; len--) { |
|
|
|
for(len = 1000; len; len--) { |
|
|
|
if(XGrabPointer(dpy, w, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, |
|
|
|
if(XGrabPointer(dpy, root, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, |
|
|
|
GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess) |
|
|
|
GrabModeAsync, GrabModeSync, None, invisible, CurrentTime) == GrabSuccess) |
|
|
|
break; |
|
|
|
break; |
|
|
|
usleep(1000); |
|
|
|
usleep(1000); |
|
|
|
} |
|
|
|
} |
|
|
|
if((running = running && (len > 0))) { |
|
|
|
if((running = running && (len > 0))) { |
|
|
|
for(len = 1000; len; len--) { |
|
|
|
for(len = 1000; len; len--) { |
|
|
|
if(XGrabKeyboard(dpy, w, True, GrabModeAsync, GrabModeAsync, CurrentTime) |
|
|
|
if(XGrabKeyboard(dpy, root, True, GrabModeAsync, GrabModeAsync, CurrentTime) |
|
|
|
== GrabSuccess) |
|
|
|
== GrabSuccess) |
|
|
|
break; |
|
|
|
break; |
|
|
|
usleep(1000); |
|
|
|
usleep(1000); |
|
|
|