|
|
@ -69,9 +69,8 @@ scan(void) { |
|
|
|
wins = NULL; |
|
|
|
wins = NULL; |
|
|
|
if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) { |
|
|
|
if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) { |
|
|
|
for(i = 0; i < num; i++) { |
|
|
|
for(i = 0; i < num; i++) { |
|
|
|
if(!XGetWindowAttributes(dpy, wins[i], &wa)) |
|
|
|
if(!XGetWindowAttributes(dpy, wins[i], &wa) |
|
|
|
continue; |
|
|
|
|| wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1)) |
|
|
|
if(wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1)) |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
if(wa.map_state == IsViewable) |
|
|
|
if(wa.map_state == IsViewable) |
|
|
|
manage(wins[i], &wa); |
|
|
|
manage(wins[i], &wa); |
|
|
@ -104,12 +103,12 @@ setup(void) { |
|
|
|
/* init modifier map */ |
|
|
|
/* init modifier map */ |
|
|
|
numlockmask = 0; |
|
|
|
numlockmask = 0; |
|
|
|
modmap = XGetModifierMapping(dpy); |
|
|
|
modmap = XGetModifierMapping(dpy); |
|
|
|
for (i = 0; i < 8; i++) { |
|
|
|
for (i = 0; i < 8; i++) |
|
|
|
for (j = 0; j < modmap->max_keypermod; j++) { |
|
|
|
for (j = 0; j < modmap->max_keypermod; j++) { |
|
|
|
if(modmap->modifiermap[i * modmap->max_keypermod + j] == XKeysymToKeycode(dpy, XK_Num_Lock)) |
|
|
|
if(modmap->modifiermap[i * modmap->max_keypermod + j] |
|
|
|
|
|
|
|
== XKeysymToKeycode(dpy, XK_Num_Lock)) |
|
|
|
numlockmask = (1 << i); |
|
|
|
numlockmask = (1 << i); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
XFreeModifiermap(modmap); |
|
|
|
XFreeModifiermap(modmap); |
|
|
|
/* select for events */ |
|
|
|
/* select for events */ |
|
|
|
wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
|
|
|
wa.event_mask = SubstructureRedirectMask | SubstructureNotifyMask |
|
|
|