[wiki] [sites] [dwm][cursorwarp] Added cursorwarp patch || Markus Dam

From: <git_AT_suckless.org>
Date: Mon, 22 Feb 2021 15:34:04 +0100

commit 14b027496a8bafe4514fb70d8efc34c982763a74
Author: Markus Dam <markus.dam123_AT_gmail.com>
Date: Mon Feb 22 15:32:54 2021 +0100

    [dwm][cursorwarp] Added cursorwarp patch

diff --git a/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-20210222-61bb8b2.diff b/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-20210222-61bb8b2.diff
new file mode 100644
index 00000000..6aa04a58
--- /dev/null
+++ b/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-20210222-61bb8b2.diff
_AT_@ -0,0 +1,33 @@
+From 1e4936416fa5517fe447e3388e1d44c913e29f56 Mon Sep 17 00:00:00 2001
+From: Markus Dam <markus.dam123_AT_gmail.com>
+Date: Mon, 22 Feb 2021 13:40:13 +0100
+Subject: [PATCH] Add cursor warping
+
+---
+ dwm.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/dwm.c b/dwm.c
+index 331a309..c80ef8a 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -882,6 +882,8 @@ focusmon(const Arg *arg)
+ unfocus(selmon->sel, 0);
+ selmon = m;
+ focus(NULL);
++ if (selmon->sel)
++ XWarpPointer(dpy, None, selmon->sel->win, 0, 0, 0, 0, selmon->sel->w/2, selmon->sel->h/2);
+ }
+
+ void
+_AT_@ -906,6 +908,7 @@ focusstack(const Arg *arg)
+ if (c) {
+ focus(c);
+ restack(selmon);
++ XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2);
+ }
+ }
+
+--
+2.30.1
+
diff --git a/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-mononly-20210222-61bb8b2.diff b/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-mononly-20210222-61bb8b2.diff
new file mode 100644
index 00000000..e1d9230b
--- /dev/null
+++ b/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-mononly-20210222-61bb8b2.diff
_AT_@ -0,0 +1,25 @@
+From 1e4936416fa5517fe447e3388e1d44c913e29f56 Mon Sep 17 00:00:00 2001
+From: Markus Dam <markus.dam123_AT_gmail.com>
+Date: Mon, 22 Feb 2021 13:40:13 +0100
+Subject: [PATCH] Add cursor warping
+
+---
+ dwm.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/dwm.c b/dwm.c
+index 331a309..c80ef8a 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -882,6 +882,8 @@ focusmon(const Arg *arg)
+ unfocus(selmon->sel, 0);
+ selmon = m;
+ focus(NULL);
++ if (selmon->sel)
++ XWarpPointer(dpy, None, selmon->sel->win, 0, 0, 0, 0, selmon->sel->w/2, selmon->sel->h/2);
+ }
+
+ void
+--
+2.30.1
+
diff --git a/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-stackonly-20210222-61bb8b2.diff b/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-stackonly-20210222-61bb8b2.diff
new file mode 100644
index 00000000..2df0a325
--- /dev/null
+++ b/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-stackonly-20210222-61bb8b2.diff
_AT_@ -0,0 +1,24 @@
+From 1e4936416fa5517fe447e3388e1d44c913e29f56 Mon Sep 17 00:00:00 2001
+From: Markus Dam <markus.dam123_AT_gmail.com>
+Date: Mon, 22 Feb 2021 13:40:13 +0100
+Subject: [PATCH] Add cursor warping
+
+---
+ dwm.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/dwm.c b/dwm.c
+index 331a309..c80ef8a 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -906,6 +908,7 @@ focusstack(const Arg *arg)
+ if (c) {
+ focus(c);
+ restack(selmon);
++ XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2);
+ }
+ }
+
+--
+2.30.1
+
diff --git a/dwm.suckless.org/patches/cursorwarp/index.md b/dwm.suckless.org/patches/cursorwarp/index.md
new file mode 100644
index 00000000..2b5ba0f1
--- /dev/null
+++ b/dwm.suckless.org/patches/cursorwarp/index.md
_AT_@ -0,0 +1,19 @@
+cursorwarp
+==========
+
+Description
+-----------
+Warp the cursor to the center of the target window when switching between them with focusstack() and focusmon()
+
+Download
+--------
+Warp cursor when changing windows and monitors
+* [dwm-cursorwarp-20210222-61bb8b2.diff](dwm-cursorwarp-20210222-61bb8b2.diff))
+Warp cursor only when changing monitors
+* [dwm-cursorwarp-mononly-20210222-61bb8b2.diff](dwm-cursorwarp-mononly-20210222-61bb8b2.diff)
+Warp cursor only when changing with focusstack()
+* [dwm-cursorwarp-stackonly-20210222-61bb8b2.diff](dwm-cursorwarp-stackonly-20210222-61bb8b2.diff)
+
+Authors
+-------
+* Markus Dam - <markus.dam123_AT_gmail.com>
Received on Mon Feb 22 2021 - 15:34:04 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 22 2021 - 15:36:51 CET