aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'window.c')
-rw-r--r--window.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/window.c b/window.c
index 72b94b2..be2c9fa 100644
--- a/window.c
+++ b/window.c
@@ -470,3 +470,14 @@ void win_set_cursor(win_t *win, cursor_t cursor)
XFlush(win->env.dpy);
}
}
+
+void win_cursor_pos(win_t *win, int *x, int *y)
+{
+ int i;
+ unsigned int ui;
+ Window w;
+
+ if (!XQueryPointer(win->env.dpy, win->xwin, &w, &w, &i, &i, x, y, &ui))
+ *x = *y = 0;
+}
+