diff options
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 25 |
1 files changed, 8 insertions, 17 deletions
| @@ -172,6 +172,7 @@ static void enternotify(XEvent *e); | |||
| 172 | static void expose(XEvent *e); | 172 | static void expose(XEvent *e); |
| 173 | static void focus(Client *c); | 173 | static void focus(Client *c); |
| 174 | static void focusin(XEvent *e); | 174 | static void focusin(XEvent *e); |
| 175 | static void focusmon(const Arg *arg); | ||
| 175 | static void focusstack(const Arg *arg); | 176 | static void focusstack(const Arg *arg); |
| 176 | static unsigned long getcolor(const char *colstr); | 177 | static unsigned long getcolor(const char *colstr); |
| 177 | static Bool getrootpointer(int *x, int *y); | 178 | static Bool getrootpointer(int *x, int *y); |
| @@ -179,6 +180,7 @@ static long getstate(Window w); | |||
| 179 | static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); | 180 | static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); |
| 180 | static void grabbuttons(Client *c, Bool focused); | 181 | static void grabbuttons(Client *c, Bool focused); |
| 181 | static void grabkeys(void); | 182 | static void grabkeys(void); |
| 183 | static Monitor *idxtomon(unsigned int n); | ||
| 182 | static void initfont(const char *fontstr); | 184 | static void initfont(const char *fontstr); |
| 183 | static Bool isprotodel(Client *c); | 185 | static Bool isprotodel(Client *c); |
| 184 | static void keypress(XEvent *e); | 186 | static void keypress(XEvent *e); |
| @@ -206,6 +208,7 @@ static void showhide(Client *c); | |||
| 206 | static void sigchld(int signal); | 208 | static void sigchld(int signal); |
| 207 | static void spawn(const Arg *arg); | 209 | static void spawn(const Arg *arg); |
| 208 | static void tag(const Arg *arg); | 210 | static void tag(const Arg *arg); |
| 211 | static void tagmon(const Arg *arg); | ||
| 209 | static int textnw(const char *text, unsigned int len); | 212 | static int textnw(const char *text, unsigned int len); |
| 210 | static void tile(Monitor *); | 213 | static void tile(Monitor *); |
| 211 | static void togglebar(const Arg *arg); | 214 | static void togglebar(const Arg *arg); |
| @@ -230,11 +233,6 @@ static int xerror(Display *dpy, XErrorEvent *ee); | |||
| 230 | static int xerrordummy(Display *dpy, XErrorEvent *ee); | 233 | static int xerrordummy(Display *dpy, XErrorEvent *ee); |
| 231 | static int xerrorstart(Display *dpy, XErrorEvent *ee); | 234 | static int xerrorstart(Display *dpy, XErrorEvent *ee); |
| 232 | static void zoom(const Arg *arg); | 235 | static void zoom(const Arg *arg); |
| 233 | #ifdef XINERAMA | ||
| 234 | static void focusmon(const Arg *arg); | ||
| 235 | static Monitor *idxtomon(unsigned int n); | ||
| 236 | static void tagmon(const Arg *arg); | ||
| 237 | #endif /* XINERAMA */ | ||
| 238 | 236 | ||
| 239 | /* variables */ | 237 | /* variables */ |
| 240 | static char stext[256]; | 238 | static char stext[256]; |
| @@ -309,9 +307,9 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h) { | |||
| 309 | *h = MAX(1, *h); | 307 | *h = MAX(1, *h); |
| 310 | 308 | ||
| 311 | if(*x > m->mx + m->mw) | 309 | if(*x > m->mx + m->mw) |
| 312 | *x = m->mw - WIDTH(c); | 310 | *x = m->mx + m->mw - WIDTH(c); |
| 313 | if(*y > m->my + m->mh) | 311 | if(*y > m->my + m->mh) |
| 314 | *y = m->mh - HEIGHT(c); | 312 | *y = m->my + m->mh - HEIGHT(c); |
| 315 | if(*x + *w + 2 * c->bw < m->mx) | 313 | if(*x + *w + 2 * c->bw < m->mx) |
| 316 | *x = m->mx; | 314 | *x = m->mx; |
| 317 | if(*y + *h + 2 * c->bw < m->my) | 315 | if(*y + *h + 2 * c->bw < m->my) |
| @@ -636,7 +634,6 @@ drawbar(Monitor *m) { | |||
| 636 | } | 634 | } |
| 637 | 635 | ||
| 638 | dc.x = 0; | 636 | dc.x = 0; |
| 639 | #ifdef XINERAMA | ||
| 640 | if(mons->next) { /* more than a single monitor */ | 637 | if(mons->next) { /* more than a single monitor */ |
| 641 | char buf[2]; | 638 | char buf[2]; |
| 642 | buf[0] = m->screen_number + '0'; | 639 | buf[0] = m->screen_number + '0'; |
| @@ -645,7 +642,6 @@ drawbar(Monitor *m) { | |||
| 645 | drawtext(buf, selmon == m ? dc.sel : dc.norm, True); | 642 | drawtext(buf, selmon == m ? dc.sel : dc.norm, True); |
| 646 | dc.x += dc.w; | 643 | dc.x += dc.w; |
| 647 | } | 644 | } |
| 648 | #endif /* XINERAMA */ | ||
| 649 | m->btx = dc.x; | 645 | m->btx = dc.x; |
| 650 | for(i = 0; i < LENGTH(tags); i++) { | 646 | for(i = 0; i < LENGTH(tags); i++) { |
| 651 | dc.w = TEXTW(tags[i]); | 647 | dc.w = TEXTW(tags[i]); |
| @@ -803,7 +799,6 @@ focusin(XEvent *e) { /* there are some broken focus acquiring clients */ | |||
| 803 | XSetInputFocus(dpy, selmon->sel->win, RevertToPointerRoot, CurrentTime); | 799 | XSetInputFocus(dpy, selmon->sel->win, RevertToPointerRoot, CurrentTime); |
| 804 | } | 800 | } |
| 805 | 801 | ||
| 806 | #ifdef XINERAMA | ||
| 807 | void | 802 | void |
| 808 | focusmon(const Arg *arg) { | 803 | focusmon(const Arg *arg) { |
| 809 | Monitor *m; | 804 | Monitor *m; |
| @@ -814,7 +809,6 @@ focusmon(const Arg *arg) { | |||
| 814 | selmon = m; | 809 | selmon = m; |
| 815 | focus(NULL); | 810 | focus(NULL); |
| 816 | } | 811 | } |
| 817 | #endif /* XINERAMA */ | ||
| 818 | 812 | ||
| 819 | void | 813 | void |
| 820 | focusstack(const Arg *arg) { | 814 | focusstack(const Arg *arg) { |
| @@ -943,7 +937,6 @@ grabkeys(void) { | |||
| 943 | } | 937 | } |
| 944 | } | 938 | } |
| 945 | 939 | ||
| 946 | #ifdef XINERAMA | ||
| 947 | Monitor * | 940 | Monitor * |
| 948 | idxtomon(unsigned int n) { | 941 | idxtomon(unsigned int n) { |
| 949 | unsigned int i; | 942 | unsigned int i; |
| @@ -952,7 +945,6 @@ idxtomon(unsigned int n) { | |||
| 952 | for(m = mons, i = 0; m && i != n; m = m->next, i++); | 945 | for(m = mons, i = 0; m && i != n; m = m->next, i++); |
| 953 | return m; | 946 | return m; |
| 954 | } | 947 | } |
| 955 | #endif /* XINERAMA */ | ||
| 956 | 948 | ||
| 957 | void | 949 | void |
| 958 | initfont(const char *fontstr) { | 950 | initfont(const char *fontstr) { |
| @@ -1378,6 +1370,7 @@ void | |||
| 1378 | sendmon(Client *c, Monitor *m) { | 1370 | sendmon(Client *c, Monitor *m) { |
| 1379 | if(c->mon == m) | 1371 | if(c->mon == m) |
| 1380 | return; | 1372 | return; |
| 1373 | unfocus(c); | ||
| 1381 | detach(c); | 1374 | detach(c); |
| 1382 | detachstack(c); | 1375 | detachstack(c); |
| 1383 | c->mon = m; | 1376 | c->mon = m; |
| @@ -1531,7 +1524,6 @@ tag(const Arg *arg) { | |||
| 1531 | } | 1524 | } |
| 1532 | } | 1525 | } |
| 1533 | 1526 | ||
| 1534 | #ifdef XINERAMA | ||
| 1535 | void | 1527 | void |
| 1536 | tagmon(const Arg *arg) { | 1528 | tagmon(const Arg *arg) { |
| 1537 | Monitor *m; | 1529 | Monitor *m; |
| @@ -1540,7 +1532,6 @@ tagmon(const Arg *arg) { | |||
| 1540 | return; | 1532 | return; |
| 1541 | sendmon(selmon->sel, m); | 1533 | sendmon(selmon->sel, m); |
| 1542 | } | 1534 | } |
| 1543 | #endif /* XINERAMA */ | ||
| 1544 | 1535 | ||
| 1545 | int | 1536 | int |
| 1546 | textnw(const char *text, unsigned int len) { | 1537 | textnw(const char *text, unsigned int len) { |
| @@ -1736,9 +1727,9 @@ updategeom(void) { | |||
| 1736 | /* default monitor setup */ | 1727 | /* default monitor setup */ |
| 1737 | { | 1728 | { |
| 1738 | m->screen_number = 0; | 1729 | m->screen_number = 0; |
| 1739 | m->wx = 0; | 1730 | m->mx = m->wx = 0; |
| 1740 | m->my = m->wy = 0; | 1731 | m->my = m->wy = 0; |
| 1741 | m->ww = sw; | 1732 | m->mw = m->ww = sw; |
| 1742 | m->mh = m->wh = sh; | 1733 | m->mh = m->wh = sh; |
| 1743 | } | 1734 | } |
| 1744 | 1735 | ||
