sowm

An itsy bitsy floating window manager (220~ sloc!).
git clone git://mfeller.io/sowm.git
Log | Files | Refs | README | LICENSE

commit 43025432ac8a01bd1e6c411f782be69edbc3a2b1
parent 8bdffcacdaa5003300ad1e00867a6541bf8d3349
Author: Dylan Araps <dylan.araps@gmail.com>
Date:   Wed, 16 Oct 2019 11:44:59 +0300

sowm: intialize cursor buttons using loop to remove duplicate code

Diffstat:
Msowm.c | 11++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sowm.c b/sowm.c @@ -571,13 +571,10 @@ int main(void) { XSelectInput(d, root, SubstructureNotifyMask| SubstructureRedirectMask|EnterWindowMask|LeaveWindowMask); - XGrabButton(d, 1, MOD, root, True, - ButtonPressMask|ButtonReleaseMask|PointerMotionMask, - GrabModeAsync, GrabModeAsync, None, None); - - XGrabButton(d, 3, MOD, root, True, - ButtonPressMask|ButtonReleaseMask|PointerMotionMask, - GrabModeAsync, GrabModeAsync, None, None); + for (int i=1; i<4; i+=2) + XGrabButton(d, i, MOD, root, True, + ButtonPressMask|ButtonReleaseMask|PointerMotionMask, + GrabModeAsync, GrabModeAsync, None, None); XDefineCursor(d, root, XCreateFontCursor(d, 68));