diff options
| author | Anselm R Garbe <garbeam@gmail.com> | 2016-12-05 10:16:46 +0100 |
|---|---|---|
| committer | Anselm R Garbe <garbeam@gmail.com> | 2016-12-05 10:16:46 +0100 |
| commit | bb3bd6fec37174e8d4bb9457ca815c00609e5157 (patch) | |
| tree | 311f225faee21df3cc378ee069808d06f9f1bb0a /dwm.c | |
| parent | applied Ivan Delalande's NET_SUPPORTING_WM_CHECK patch for gtk3 compatibility (diff) | |
| download | dwm-bb3bd6fec37174e8d4bb9457ca815c00609e5157.tar.gz dwm-bb3bd6fec37174e8d4bb9457ca815c00609e5157.zip | |
applied Markus' tagset purge of alternative view on _NET_ACTIVE_WINDOW event
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 38 |
1 files changed, 18 insertions, 20 deletions
| @@ -153,7 +153,6 @@ static void buttonpress(XEvent *e); | |||
| 153 | static void checkotherwm(void); | 153 | static void checkotherwm(void); |
| 154 | static void cleanup(void); | 154 | static void cleanup(void); |
| 155 | static void cleanupmon(Monitor *mon); | 155 | static void cleanupmon(Monitor *mon); |
| 156 | static void clearurgent(Client *c); | ||
| 157 | static void clientmessage(XEvent *e); | 156 | static void clientmessage(XEvent *e); |
| 158 | static void configure(Client *c); | 157 | static void configure(Client *c); |
| 159 | static void configurenotify(XEvent *e); | 158 | static void configurenotify(XEvent *e); |
| @@ -204,6 +203,7 @@ static void setfullscreen(Client *c, int fullscreen); | |||
| 204 | static void setlayout(const Arg *arg); | 203 | static void setlayout(const Arg *arg); |
| 205 | static void setmfact(const Arg *arg); | 204 | static void setmfact(const Arg *arg); |
| 206 | static void setup(void); | 205 | static void setup(void); |
| 206 | static void seturgent(Client *c, int urg); | ||
| 207 | static void showhide(Client *c); | 207 | static void showhide(Client *c); |
| 208 | static void sigchld(int unused); | 208 | static void sigchld(int unused); |
| 209 | static void spawn(const Arg *arg); | 209 | static void spawn(const Arg *arg); |
| @@ -509,19 +509,6 @@ cleanupmon(Monitor *mon) | |||
| 509 | } | 509 | } |
| 510 | 510 | ||
| 511 | void | 511 | void |
| 512 | clearurgent(Client *c) | ||
| 513 | { | ||
| 514 | XWMHints *wmh; | ||
| 515 | |||
| 516 | c->isurgent = 0; | ||
| 517 | if (!(wmh = XGetWMHints(dpy, c->win))) | ||
| 518 | return; | ||
| 519 | wmh->flags &= ~XUrgencyHint; | ||
| 520 | XSetWMHints(dpy, c->win, wmh); | ||
| 521 | XFree(wmh); | ||
| 522 | } | ||
| 523 | |||
| 524 | void | ||
| 525 | clientmessage(XEvent *e) | 512 | clientmessage(XEvent *e) |
| 526 | { | 513 | { |
| 527 | XClientMessageEvent *cme = &e->xclient; | 514 | XClientMessageEvent *cme = &e->xclient; |
| @@ -534,11 +521,8 @@ clientmessage(XEvent *e) | |||
| 534 | setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ | 521 | setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ |
| 535 | || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); | 522 | || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); |
| 536 | } else if (cme->message_type == netatom[NetActiveWindow]) { | 523 | } else if (cme->message_type == netatom[NetActiveWindow]) { |
| 537 | if (!ISVISIBLE(c)) { | 524 | if (c != selmon->sel && !c->isurgent) |
| 538 | c->mon->seltags ^= 1; | 525 | seturgent(c, 1); |
| 539 | c->mon->tagset[c->mon->seltags] = c->tags; | ||
| 540 | } | ||
| 541 | pop(c); | ||
| 542 | } | 526 | } |
| 543 | } | 527 | } |
| 544 | 528 | ||
| @@ -806,7 +790,7 @@ focus(Client *c) | |||
| 806 | if (c->mon != selmon) | 790 | if (c->mon != selmon) |
| 807 | selmon = c->mon; | 791 | selmon = c->mon; |
| 808 | if (c->isurgent) | 792 | if (c->isurgent) |
| 809 | clearurgent(c); | 793 | seturgent(c, 0); |
| 810 | detachstack(c); | 794 | detachstack(c); |
| 811 | attachstack(c); | 795 | attachstack(c); |
| 812 | grabbuttons(c, 1); | 796 | grabbuttons(c, 1); |
| @@ -1616,6 +1600,20 @@ setup(void) | |||
| 1616 | focus(NULL); | 1600 | focus(NULL); |
| 1617 | } | 1601 | } |
| 1618 | 1602 | ||
| 1603 | |||
| 1604 | void | ||
| 1605 | seturgent(Client *c, int urg) | ||
| 1606 | { | ||
| 1607 | XWMHints *wmh; | ||
| 1608 | |||
| 1609 | c->isurgent = urg; | ||
| 1610 | if (!(wmh = XGetWMHints(dpy, c->win))) | ||
| 1611 | return; | ||
| 1612 | wmh->flags = urg ? (wmh->flags | XUrgencyHint) : (wmh->flags & ~XUrgencyHint); | ||
| 1613 | XSetWMHints(dpy, c->win, wmh); | ||
| 1614 | XFree(wmh); | ||
| 1615 | } | ||
| 1616 | |||
| 1619 | void | 1617 | void |
| 1620 | showhide(Client *c) | 1618 | showhide(Client *c) |
| 1621 | { | 1619 | { |
