214a215 > static void switchtag(const Arg *arg); 233a235 > static void refreshtagcache(int tagmask); 1522c1524,1525 < |PropertyChangeMask; --- > |PropertyChangeMask > |KeyReleaseMask; 1565a1569,1592 > switchtag(const Arg *arg) { > Client *c; > unsigned int i = 0; > Client *selclient = selmon->sel; > const XEvent ev = {.type = 0}; > > if (selmon->clients == NULL) return; > XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync, CurrentTime); > do { > if (ev.type == KeyRelease) continue; > do { > if (++i >= LENGTH(tagcache) || tagcache[i] == -1) i = 0; > for (c = selmon->clients; c != NULL && !(c->tags & tagcache[i]); c = c->next); > } while (c == NULL); > if ((arg->ui == 1)) selclient->tags = tagcache[i]; > selmon->tagset[selmon->seltags] = tagcache[i]; > arrange(selmon); > } while (!XMaskEvent(dpy, KeyReleaseMask|KeyPressMask, (XEvent*)&ev) && > ((XKeycodeToKeysym(dpy, (KeyCode)ev.xkey.keycode, 0) == SWITCHTAGKEY))); > XUngrabKeyboard(dpy, CurrentTime); > refreshtagcache(selmon->tagset[selmon->seltags]); > } > > void 1569a1597,1598 > refreshtagcache(arg->ui & TAGMASK); > refreshtagcache(selmon->tagset[selmon->seltags]); 1659a1689 > refreshtagcache(selmon->tagset[selmon->seltags]); 1913a1944,1953 > refreshtagcache(int tagmask) { > unsigned int i; > if((tagcache[0] == tagmask)) return; > for (i = 1; i <= LENGTH(tagcache)-1 && tagcache[i] != tagmask; i++); > if (i == LENGTH(tagcache)) i = LENGTH(tagcache) - 1; > for (; i > 0; i--) tagcache[i] = tagcache[i-1]; > tagcache[0] = tagmask; > } > > void 1920a1961 > refreshtagcache(selmon->tagset[selmon->seltags]);