summaryrefslogtreecommitdiff
path: root/patches_dwm/dwm-cursorwarp-mononly-20210222-61bb8b2.diff
blob: e1d9230be33d4bd701eae6a9411313dc6d333ad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From 1e4936416fa5517fe447e3388e1d44c913e29f56 Mon Sep 17 00:00:00 2001
From: Markus Dam <markus.dam123@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
@@ -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