181 void unmanage(Client *c); |
180 void unmanage(Client *c); |
182 void unmapnotify(XEvent *e); |
181 void unmapnotify(XEvent *e); |
183 void updatebar(void); |
182 void updatebar(void); |
184 void updategeom(void); |
183 void updategeom(void); |
185 void updatesizehints(Client *c); |
184 void updatesizehints(Client *c); |
186 void updatetilegeom(void); |
|
187 void updatetitle(Client *c); |
185 void updatetitle(Client *c); |
188 void updatewmhints(Client *c); |
186 void updatewmhints(Client *c); |
189 void view(const void *arg); |
187 void view(const void *arg); |
190 void viewprevtag(const void *arg); |
188 void viewprevtag(const void *arg); |
191 int xerror(Display *dpy, XErrorEvent *ee); |
189 int xerror(Display *dpy, XErrorEvent *ee); |
195 |
193 |
196 /* variables */ |
194 /* variables */ |
197 char stext[256]; |
195 char stext[256]; |
198 int screen, sx, sy, sw, sh; |
196 int screen, sx, sy, sw, sh; |
199 int bx, by, bw, bh, blw, wx, wy, ww, wh; |
197 int bx, by, bw, bh, blw, wx, wy, ww, wh; |
200 int mx, my, mw, mh, tx, ty, tw, th; |
|
201 uint seltags = 0; |
198 uint seltags = 0; |
202 int (*xerrorxlib)(Display *, XErrorEvent *); |
199 int (*xerrorxlib)(Display *, XErrorEvent *); |
203 uint numlockmask = 0; |
200 uint numlockmask = 0; |
204 void (*handler[LASTEvent]) (XEvent *) = { |
201 void (*handler[LASTEvent]) (XEvent *) = { |
205 [ButtonPress] = buttonpress, |
202 [ButtonPress] = buttonpress, |
1437 return XTextWidth(dc.font.xfont, text, len); |
1433 return XTextWidth(dc.font.xfont, text, len); |
1438 } |
1434 } |
1439 |
1435 |
1440 void |
1436 void |
1441 tile(void) { |
1437 tile(void) { |
1442 int x, y, h, w; |
1438 int x, y, h, w, mx, my, mw, mh, tx, ty, tw, th; |
1443 uint i, n; |
1439 uint i, n; |
1444 Client *c; |
1440 Client *c; |
1445 |
1441 |
1446 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next), n++); |
1442 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next), n++); |
1447 if(n == 0) |
1443 if(n == 0) |
1448 return; |
1444 return; |
|
1445 |
|
1446 /* master area geometry */ |
|
1447 mx = wx; |
|
1448 my = wy; |
|
1449 mw = mfact * ww; |
|
1450 mh = wh; |
|
1451 |
|
1452 /* tile area geometry */ |
|
1453 tx = mx + mw; |
|
1454 ty = wy; |
|
1455 tw = ww - mw; |
|
1456 th = wh; |
1449 |
1457 |
1450 /* master */ |
1458 /* master */ |
1451 c = nexttiled(clients); |
1459 c = nexttiled(clients); |
1452 |
1460 |
1453 if(n == 1) |
1461 if(n == 1) |
1668 } |
1671 } |
1669 else |
1672 else |
1670 c->minax = c->maxax = c->minay = c->maxay = 0; |
1673 c->minax = c->maxax = c->minay = c->maxay = 0; |
1671 c->isfixed = (c->maxw && c->minw && c->maxh && c->minh |
1674 c->isfixed = (c->maxw && c->minw && c->maxh && c->minh |
1672 && c->maxw == c->minw && c->maxh == c->minh); |
1675 && c->maxw == c->minw && c->maxh == c->minh); |
1673 } |
|
1674 |
|
1675 void |
|
1676 updatetilegeom(void) { |
|
1677 /* master area geometry */ |
|
1678 mx = wx; |
|
1679 my = wy; |
|
1680 mw = mfact * ww; |
|
1681 mh = wh; |
|
1682 |
|
1683 /* tile area geometry */ |
|
1684 tx = mx + mw; |
|
1685 ty = wy; |
|
1686 tw = ww - mw; |
|
1687 th = wh; |
|
1688 } |
1676 } |
1689 |
1677 |
1690 void |
1678 void |
1691 updatetitle(Client *c) { |
1679 updatetitle(Client *c) { |
1692 if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) |
1680 if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) |