[wiki] [sites] [dwm][patch][cursorwarp] Added modified patch for 6.3. || Finn Rayment

From: <git_AT_suckless.org>
Date: Sun, 21 Aug 2022 06:18:30 +0200

commit 95139e2d019509fe53fbedc54448796af2ff9c6a
Author: Finn Rayment <finn_AT_rayment.fr>
Date: Sun Aug 21 14:05:00 2022 +1000

    [dwm][patch][cursorwarp] Added modified patch for 6.3.

diff --git a/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-6.3.diff b/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-6.3.diff
new file mode 100644
index 00000000..c9c18d87
--- /dev/null
+++ b/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-6.3.diff
_AT_@ -0,0 +1,52 @@
+From 94362c75d92a77d11dfbfecce89394b2e0078cd0 Mon Sep 17 00:00:00 2001
+From: Finn Rayment <finn_AT_rayment.fr>
+Date: Sun, 21 Aug 2022 13:56:50 +1000
+Subject: [PATCH] Added cursor warp for refocus and window spawn/death
+
+---
+ dwm.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/dwm.c b/dwm.c
+index a96f33c..f0e8a39 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -831,6 +831,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_@ -856,6 +858,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);
+ }
+ }
+
+_AT_@ -1077,6 +1080,8 @@ manage(Window w, XWindowAttributes *wa)
+ c->mon->sel = c;
+ arrange(c->mon);
+ XMapWindow(dpy, c->win);
++ if (c && c->mon == selmon)
++ XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2);
+ focus(NULL);
+ }
+
+_AT_@ -1788,6 +1793,9 @@ unmanage(Client *c, int destroyed)
+ focus(NULL);
+ updateclientlist();
+ arrange(m);
++ if (m == selmon)
++ XWarpPointer(dpy, None, m->sel->win, 0, 0, 0, 0,
++ m->sel->w/2, m->sel->h/2);
+ }
+
+ void
+--
+2.35.1
+
diff --git a/dwm.suckless.org/patches/cursorwarp/index.md b/dwm.suckless.org/patches/cursorwarp/index.md
index 2b5ba0f1..598425eb 100644
--- a/dwm.suckless.org/patches/cursorwarp/index.md
+++ b/dwm.suckless.org/patches/cursorwarp/index.md
_AT_@ -3,10 +3,12 @@ cursorwarp
 
 Description
 -----------
-Warp the cursor to the center of the target window when switching between them with focusstack() and focusmon()
+Warp the cursor to the center of the target window when switching between them with focusstack(), focusmon(), manage() and unmanage()
 
 Download
 --------
+Warp cursor when changing windows, monitors, spawning and killing windows
+* [dwm-cursorwarp-6.3.diff](dwm-cursorwarp-6.3.diff))
 Warp cursor when changing windows and monitors
 * [dwm-cursorwarp-20210222-61bb8b2.diff](dwm-cursorwarp-20210222-61bb8b2.diff))
 Warp cursor only when changing monitors
_AT_@ -16,4 +18,5 @@ Warp cursor only when changing with focusstack()
 
 Authors
 -------
+* Finn Rayment - <finn_AT_rayment.fr>
 * Markus Dam - <markus.dam123_AT_gmail.com>
Received on Sun Aug 21 2022 - 06:18:30 CEST

This archive was generated by hypermail 2.3.0 : Sun Aug 21 2022 - 06:24:50 CEST