gliv-1.7
[gliv.git] / src / move_pointer.c
blob00eaa7fa438a616cd8a1d4e15470c5705c47bf0a
1 /*********************
2 * Extension to GDK. *
3 *********************/
5 #include <gdk/gdkx.h>
7 void move_pointer(gint dest_x, gint dest_y);
9 #define EVENT_MASK Button1MotionMask | Button4MotionMask | ButtonMotionMask | \
10 Button2MotionMask | Button5MotionMask | PointerMotionMask | \
11 Button3MotionMask | PointerMotionHintMask
14 * Move the pointer to the (x, y) coordinates of the root window
15 * without respect to the current pointer position.
17 void move_pointer(gint dest_x, gint dest_y)
19 Display *dpy;
20 XEvent xev;
22 dpy = GDK_DISPLAY();
24 while (XCheckMaskEvent(dpy, EVENT_MASK, &xev) == True);
26 XWarpPointer(dpy, None, GDK_ROOT_WINDOW(), 0, 0, 0, 0, dest_x, dest_y);