fixed wrong tagging stuff
7a496e97
2 file(s) · +14 −14
| 13 | 13 | ||
| 14 | 14 | /* tagging */ |
|
| 15 | 15 | const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "www" }; |
|
| 16 | - | Bool seltags[LENGTH(tags)] = {[0] = True}; |
|
| 16 | + | Bool initags[LENGTH(tags)] = {[0] = True}; |
|
| 17 | 17 | Rule rules[] = { |
|
| 18 | 18 | /* class:instance:title regex tags regex isfloating */ |
|
| 19 | 19 | { "Firefox", "www", False }, |
| 297 | 297 | if(ch.res_name) |
|
| 298 | 298 | XFree(ch.res_name); |
|
| 299 | 299 | if(!matched_tag) |
|
| 300 | - | memcpy(c->tags, monitors[monitorat(-1, -1)].seltags, sizeof seltags); |
|
| 300 | + | memcpy(c->tags, monitors[monitorat(-1, -1)].seltags, sizeof initags); |
|
| 301 | 301 | if (!matched_monitor) |
|
| 302 | 302 | c->monitor = monitorat(-1, -1); |
|
| 303 | 303 | } |
|
| 1056 | 1056 | XWindowChanges wc; |
|
| 1057 | 1057 | ||
| 1058 | 1058 | c = emallocz(sizeof(Client)); |
|
| 1059 | - | c->tags = emallocz(sizeof seltags); |
|
| 1059 | + | c->tags = emallocz(sizeof initags); |
|
| 1060 | 1060 | c->win = w; |
|
| 1061 | 1061 | ||
| 1062 | 1062 | applyrules(c); |
|
| 1100 | 1100 | if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success)) |
|
| 1101 | 1101 | for(t = clients; t && t->win != trans; t = t->next); |
|
| 1102 | 1102 | if(t) |
|
| 1103 | - | memcpy(c->tags, t->tags, sizeof seltags); |
|
| 1103 | + | memcpy(c->tags, t->tags, sizeof initags); |
|
| 1104 | 1104 | if(!c->isfloating) |
|
| 1105 | 1105 | c->isfloating = (rettrans == Success) || c->isfixed; |
|
| 1106 | 1106 | attach(c); |
|
| 1181 | 1181 | else if(abs((m->way + m->wah) - (ny + c->h + 2 * c->border)) < SNAP) |
|
| 1182 | 1182 | ny = m->way + m->wah - c->h - 2 * c->border; |
|
| 1183 | 1183 | resize(c, nx, ny, c->w, c->h, False); |
|
| 1184 | - | memcpy(c->tags, monitors[monitorat(nx, ny)].seltags, sizeof seltags); |
|
| 1184 | + | memcpy(c->tags, monitors[monitorat(nx, ny)].seltags, sizeof initags); |
|
| 1185 | 1185 | break; |
|
| 1186 | 1186 | } |
|
| 1187 | 1187 | } |
|
| 1591 | 1591 | } |
|
| 1592 | 1592 | ||
| 1593 | 1593 | monitors[i].id = i; |
|
| 1594 | - | monitors[i].seltags = emallocz(LENGTH(tags)*sizeof(char*)); |
|
| 1595 | - | monitors[i].prevtags = emallocz(LENGTH(tags)*sizeof(char*)); |
|
| 1594 | + | monitors[i].seltags = emallocz(sizeof initags); |
|
| 1595 | + | monitors[i].prevtags = emallocz(sizeof initags); |
|
| 1596 | 1596 | ||
| 1597 | - | memcpy(monitors[i].seltags, seltags, sizeof seltags); |
|
| 1598 | - | memcpy(monitors[i].prevtags, seltags, sizeof seltags); |
|
| 1597 | + | memcpy(monitors[i].seltags, initags, sizeof initags); |
|
| 1598 | + | memcpy(monitors[i].prevtags, initags, sizeof initags); |
|
| 1599 | 1599 | ||
| 1600 | 1600 | /* init appearance */ |
|
| 1601 | 1601 | monitors[i].dc.norm[ColBorder] = getcolor(NORMBORDERCOLOR); |
|
| 1950 | 1950 | ||
| 1951 | 1951 | Monitor *m = &monitors[monitorat(-1, -1)]; |
|
| 1952 | 1952 | ||
| 1953 | - | memcpy(m->prevtags, seltags, sizeof seltags); |
|
| 1953 | + | memcpy(m->prevtags, m->seltags, sizeof initags); |
|
| 1954 | 1954 | for(i = 0; i < LENGTH(tags); i++) |
|
| 1955 | 1955 | m->seltags[i] = (NULL == arg); |
|
| 1956 | 1956 | m->seltags[idxoftag(arg)] = True; |
|
| 1963 | 1963 | ||
| 1964 | 1964 | Monitor *m = &monitors[monitorat(-1, -1)]; |
|
| 1965 | 1965 | ||
| 1966 | - | memcpy(tmp, m->seltags, sizeof seltags); |
|
| 1967 | - | memcpy(m->seltags, m->prevtags, sizeof seltags); |
|
| 1968 | - | memcpy(m->prevtags, tmp, sizeof seltags); |
|
| 1966 | + | memcpy(tmp, m->seltags, sizeof initags); |
|
| 1967 | + | memcpy(m->seltags, m->prevtags, sizeof initags); |
|
| 1968 | + | memcpy(m->prevtags, tmp, sizeof initags); |
|
| 1969 | 1969 | arrange(); |
|
| 1970 | 1970 | } |
|
| 1971 | 1971 | ||
| 2011 | 2011 | if (sel) { |
|
| 2012 | 2012 | sel->monitor = arg ? atoi(arg) : (sel->monitor+1) % mcount; |
|
| 2013 | 2013 | ||
| 2014 | - | memcpy(sel->tags, monitors[sel->monitor].seltags, sizeof seltags); |
|
| 2014 | + | memcpy(sel->tags, monitors[sel->monitor].seltags, sizeof initags); |
|
| 2015 | 2015 | resize(sel, monitors[sel->monitor].wax, monitors[sel->monitor].way, sel->w, sel->h, True); |
|
| 2016 | 2016 | arrange(); |
|
| 2017 | 2017 | } |
|