Own win method for mouse cursor location

This commit is contained in:
Bert Münnich
2017-10-05 13:47:02 +02:00
parent b8fd923e74
commit d81442f55d
3 changed files with 16 additions and 6 deletions

View File

@ -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;
}