#include #include #include #include #include #include #include #include #include // listen for mouse motion in all windows under the given one // void listen_for_mouse(Display* display, Window window) { Window parent, *children; unsigned int nchildren; int retval; retval = XQueryTree(display, window, &window, &parent, &children, &nchildren); if (retval == FALSE) { fprintf(stderr, "XQueryTree() failed: %d\n", retval); return; } if (nchildren == 0) return; XSelectInput(display, window, PointerMotionMask); for (int i=0; i