applied noviewprev.diff, fix.diff and unusedflags.diff
c2784e4a
2 file(s) · +17 −24
| 51 | 51 | { MODKEY, XK_l, setmfact, (double[]){+0.05} }, |
|
| 52 | 52 | { MODKEY, XK_m, togglemax, NULL }, |
|
| 53 | 53 | { MODKEY, XK_Return, zoom, NULL }, |
|
| 54 | - | { MODKEY, XK_Tab, viewprevtag, NULL }, |
|
| 54 | + | { MODKEY, XK_Tab, view, NULL }, |
|
| 55 | 55 | { MODKEY|ShiftMask, XK_c, killclient, NULL }, |
|
| 56 | 56 | { MODKEY, XK_space, togglelayout, NULL }, |
|
| 57 | 57 | { MODKEY|ShiftMask, XK_space, togglefloating, NULL }, |
| 69 | 69 | int x, y, w, h; |
|
| 70 | 70 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; |
|
| 71 | 71 | int minax, maxax, minay, maxay; |
|
| 72 | - | long flags; |
|
| 73 | 72 | int bw, oldbw; |
|
| 74 | 73 | Bool isbanned, isfixed, isfloating, ismoved, isurgent; |
|
| 75 | 74 | uint tags; |
|
| 183 | 182 | void updatetitle(Client *c); |
|
| 184 | 183 | void updatewmhints(Client *c); |
|
| 185 | 184 | void view(const void *arg); |
|
| 186 | - | void viewprevtag(const void *arg); |
|
| 187 | 185 | int xerror(Display *dpy, XErrorEvent *ee); |
|
| 188 | 186 | int xerrordummy(Display *dpy, XErrorEvent *ee); |
|
| 189 | 187 | int xerrorstart(Display *dpy, XErrorEvent *ee); |
|
| 419 | 417 | if((c = getclient(ev->window))) { |
|
| 420 | 418 | if(ev->value_mask & CWBorderWidth) |
|
| 421 | 419 | c->bw = ev->border_width; |
|
| 422 | - | if(c->isfixed || c->isfloating || !lt->arrange) { |
|
| 420 | + | if(ismax && !c->isbanned && !c->isfixed) |
|
| 421 | + | XMoveResizeWindow(dpy, c->win, wx, wy, ww - 2 * c->bw, wh + 2 * c->bw); |
|
| 422 | + | else if(c->isfloating || !lt->arrange) { |
|
| 423 | 423 | if(ev->value_mask & CWX) |
|
| 424 | 424 | c->x = sx + ev->x; |
|
| 425 | 425 | if(ev->value_mask & CWY) |
|
| 946 | 946 | applyrules(c); |
|
| 947 | 947 | if(!c->isfloating) |
|
| 948 | 948 | c->isfloating = (rettrans == Success) || c->isfixed; |
|
| 949 | + | if(c->isfloating) |
|
| 950 | + | XRaiseWindow(dpy, c->win); |
|
| 949 | 951 | attach(c); |
|
| 950 | 952 | attachstack(c); |
|
| 951 | 953 | XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); /* some windows require this */ |
|
| 1124 | 1126 | if(w < bh) |
|
| 1125 | 1127 | w = bh; |
|
| 1126 | 1128 | if(c->x != x || c->y != y || c->w != w || c->h != h || c->ismoved) { |
|
| 1127 | - | c->isbanned = c->ismoved = False; |
|
| 1129 | + | c->ismoved = False; |
|
| 1128 | 1130 | c->x = wc.x = x; |
|
| 1129 | 1131 | c->y = wc.y = y; |
|
| 1130 | 1132 | c->w = wc.width = w; |
|
| 1601 | 1603 | long msize; |
|
| 1602 | 1604 | XSizeHints size; |
|
| 1603 | 1605 | ||
| 1604 | - | if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags) |
|
| 1605 | - | size.flags = PSize; |
|
| 1606 | - | c->flags = size.flags; |
|
| 1607 | - | if(c->flags & PBaseSize) { |
|
| 1606 | + | XGetWMNormalHints(dpy, c->win, &size, &msize); |
|
| 1607 | + | if(size.flags & PBaseSize) { |
|
| 1608 | 1608 | c->basew = size.base_width; |
|
| 1609 | 1609 | c->baseh = size.base_height; |
|
| 1610 | 1610 | } |
|
| 1611 | - | else if(c->flags & PMinSize) { |
|
| 1611 | + | else if(size.flags & PMinSize) { |
|
| 1612 | 1612 | c->basew = size.min_width; |
|
| 1613 | 1613 | c->baseh = size.min_height; |
|
| 1614 | 1614 | } |
|
| 1615 | 1615 | else |
|
| 1616 | 1616 | c->basew = c->baseh = 0; |
|
| 1617 | - | if(c->flags & PResizeInc) { |
|
| 1617 | + | if(size.flags & PResizeInc) { |
|
| 1618 | 1618 | c->incw = size.width_inc; |
|
| 1619 | 1619 | c->inch = size.height_inc; |
|
| 1620 | 1620 | } |
|
| 1621 | 1621 | else |
|
| 1622 | 1622 | c->incw = c->inch = 0; |
|
| 1623 | - | if(c->flags & PMaxSize) { |
|
| 1623 | + | if(size.flags & PMaxSize) { |
|
| 1624 | 1624 | c->maxw = size.max_width; |
|
| 1625 | 1625 | c->maxh = size.max_height; |
|
| 1626 | 1626 | } |
|
| 1627 | 1627 | else |
|
| 1628 | 1628 | c->maxw = c->maxh = 0; |
|
| 1629 | - | if(c->flags & PMinSize) { |
|
| 1629 | + | if(size.flags & PMinSize) { |
|
| 1630 | 1630 | c->minw = size.min_width; |
|
| 1631 | 1631 | c->minh = size.min_height; |
|
| 1632 | 1632 | } |
|
| 1633 | - | else if(c->flags & PBaseSize) { |
|
| 1633 | + | else if(size.flags & PBaseSize) { |
|
| 1634 | 1634 | c->minw = size.base_width; |
|
| 1635 | 1635 | c->minh = size.base_height; |
|
| 1636 | 1636 | } |
|
| 1637 | 1637 | else |
|
| 1638 | 1638 | c->minw = c->minh = 0; |
|
| 1639 | - | if(c->flags & PAspect) { |
|
| 1639 | + | if(size.flags & PAspect) { |
|
| 1640 | 1640 | c->minax = size.min_aspect.x; |
|
| 1641 | 1641 | c->maxax = size.max_aspect.x; |
|
| 1642 | 1642 | c->minay = size.min_aspect.y; |
|
| 1669 | 1669 | ||
| 1670 | 1670 | void |
|
| 1671 | 1671 | view(const void *arg) { |
|
| 1672 | - | if(*(int *)arg & TAGMASK) { |
|
| 1673 | - | seltags ^= 1; /* toggle sel tagset */ |
|
| 1672 | + | seltags ^= 1; /* toggle sel tagset */ |
|
| 1673 | + | if(arg && (*(int *)arg & TAGMASK)) |
|
| 1674 | 1674 | tagset[seltags] = *(int *)arg & TAGMASK; |
|
| 1675 | - | arrange(); |
|
| 1676 | - | } |
|
| 1677 | - | } |
|
| 1678 | - | ||
| 1679 | - | void |
|
| 1680 | - | viewprevtag(const void *arg) { |
|
| 1681 | - | seltags ^= 1; /* toggle sel tagset */ |
|
| 1682 | 1675 | arrange(); |
|
| 1683 | 1676 | } |
|
| 1684 | 1677 | ||