about summary refs log tree commit diff stats
path: root/patches/6-cursorwarp-6.3.diff
diff options
context:
space:
mode:
authorAcid Bong <acid-bong@cock.lt>2022-10-19 13:15:14 +0300
committerAcid Bong <acid-bong@cock.lt>2022-10-19 13:15:14 +0300
commitabd174196e98af390857d3bbc924a3cfac6f27d9 (patch)
tree93f6cfe4498a0f9f4be072a6d5e4ac0e92c51b91 /patches/6-cursorwarp-6.3.diff
parent55c72c9467270d2660af66e2052b876eec254104 (diff)
downloaddwm-abd174196e98af390857d3bbc924a3cfac6f27d9.tar.gz
patch: cursorwarp (included)
Diffstat (limited to 'patches/6-cursorwarp-6.3.diff')
-rw-r--r--patches/6-cursorwarp-6.3.diff52
1 files changed, 52 insertions, 0 deletions
diff --git a/patches/6-cursorwarp-6.3.diff b/patches/6-cursorwarp-6.3.diff
new file mode 100644
index 0000000..39be99d
--- /dev/null
+++ b/patches/6-cursorwarp-6.3.diff
@@ -0,0 +1,52 @@
+From 94362c75d92a77d11dfbfecce89394b2e0078cd0 Mon Sep 17 00:00:00 2001
+From: Finn Rayment <finn@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
+@@ -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
+@@ -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);
+ 	}
+ }
+ 
+@@ -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);
+ }
+ 
+@@ -1788,6 +1793,9 @@ unmanage(Client *c, int destroyed)
+ 	focus(NULL);
+ 	updateclientlist();
+ 	arrange(m);
++	if (m == selmon && m->sel)
++		XWarpPointer(dpy, None, m->sel->win, 0, 0, 0, 0,
++		             m->sel->w/2, m->sel->h/2);
+ }
+ 
+ void
+-- 
+2.35.1
+
217'>217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301