sowm: intialize cursor buttons using loop to remove duplicate code

This commit is contained in:
Dylan Araps 2019-10-16 11:44:59 +03:00
parent 8bdffcacda
commit 43025432ac
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 4 additions and 7 deletions

11
sowm.c
View File

@ -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));