From dad6dc77433e661b54458978cb888fd38ae15a97 Mon Sep 17 00:00:00 2001 From: Nikita Langer Date: Mon, 6 Apr 2026 22:13:26 +0200 Subject: Initial commit --- modules/warptoclient/warptoclient.c | 15 +++++++++++++++ modules/warptoclient/warptoclient.h | 1 + 2 files changed, 16 insertions(+) create mode 100644 modules/warptoclient/warptoclient.c create mode 100644 modules/warptoclient/warptoclient.h (limited to 'modules/warptoclient') diff --git a/modules/warptoclient/warptoclient.c b/modules/warptoclient/warptoclient.c new file mode 100644 index 0000000..fbedeaa --- /dev/null +++ b/modules/warptoclient/warptoclient.c @@ -0,0 +1,15 @@ +void +warptoclient(Client *c) +{ + int x, y; + + if (!c) { + XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww/2, selmon->wy + selmon->wh/2); + return; + } + + x = c->x + WIDTH(c) / 2; + y = c->y + HEIGHT(c) / 2; + + XWarpPointer(dpy, None, root, 0, 0, 0, 0, x, y); +} diff --git a/modules/warptoclient/warptoclient.h b/modules/warptoclient/warptoclient.h new file mode 100644 index 0000000..0017968 --- /dev/null +++ b/modules/warptoclient/warptoclient.h @@ -0,0 +1 @@ +static void warptoclient(Client *c); -- cgit