sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 14b027496a8bafe4514fb70d8efc34c982763a74
parent f2958b1d8619adb338c223145d781eaca4f8e09d
Author: Markus Dam <markus.dam123@gmail.com>
Date:   Mon, 22 Feb 2021 15:32:54 +0100

[dwm][cursorwarp] Added cursorwarp patch

Diffstat:
Adwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-20210222-61bb8b2.diff | 33+++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-mononly-20210222-61bb8b2.diff | 25+++++++++++++++++++++++++
Adwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-stackonly-20210222-61bb8b2.diff | 24++++++++++++++++++++++++
Adwm.suckless.org/patches/cursorwarp/index.md | 19+++++++++++++++++++
4 files changed, 101 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-20210222-61bb8b2.diff b/dwm.suckless.org/patches/cursorwarp/dwm-cursorwarp-20210222-61bb8b2.diff @@ -0,0 +1,33 @@ +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 +@@ -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 @@ -0,0 +1,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 + 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 @@ -0,0 +1,24 @@ +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 +@@ -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 @@ -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@gmail.com>