aboutsummaryrefslogtreecommitdiffstats
path: root/modules/warptoclient/warptoclient.c
diff options
context:
space:
mode:
authorNikita Langer <nikitalanger@icloud.com>2026-04-06 22:13:26 +0200
committerNikita Langer <nikitalanger@icloud.com>2026-04-06 22:13:26 +0200
commitdad6dc77433e661b54458978cb888fd38ae15a97 (patch)
treeed0ea2232063526124609e8e1fde67bdff72031d /modules/warptoclient/warptoclient.c
downloadvxwm-dad6dc77433e661b54458978cb888fd38ae15a97.tar.gz
vxwm-dad6dc77433e661b54458978cb888fd38ae15a97.tar.bz2
vxwm-dad6dc77433e661b54458978cb888fd38ae15a97.tar.xz
vxwm-dad6dc77433e661b54458978cb888fd38ae15a97.zip
Initial commitHEADmaster
Diffstat (limited to 'modules/warptoclient/warptoclient.c')
-rw-r--r--modules/warptoclient/warptoclient.c15
1 files changed, 15 insertions, 0 deletions
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);
+}