summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2016-12-05 10:16:46 +0100
committerAnselm R Garbe <garbeam@gmail.com>2016-12-05 10:16:46 +0100
commitbb3bd6fec37174e8d4bb9457ca815c00609e5157 (patch)
tree311f225faee21df3cc378ee069808d06f9f1bb0a /dwm.c
parentapplied Ivan Delalande's NET_SUPPORTING_WM_CHECK patch for gtk3 compatibility (diff)
downloaddwm-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.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/dwm.c b/dwm.c
index ca6f679..d27cb67 100644
--- a/dwm.c
+++ b/dwm.c
@@ -153,7 +153,6 @@ static void buttonpress(XEvent *e);
153static void checkotherwm(void); 153static void checkotherwm(void);
154static void cleanup(void); 154static void cleanup(void);
155static void cleanupmon(Monitor *mon); 155static void cleanupmon(Monitor *mon);
156static void clearurgent(Client *c);
157static void clientmessage(XEvent *e); 156static void clientmessage(XEvent *e);
158static void configure(Client *c); 157static void configure(Client *c);
159static void configurenotify(XEvent *e); 158static void configurenotify(XEvent *e);
@@ -204,6 +203,7 @@ static void setfullscreen(Client *c, int fullscreen);
204static void setlayout(const Arg *arg); 203static void setlayout(const Arg *arg);
205static void setmfact(const Arg *arg); 204static void setmfact(const Arg *arg);
206static void setup(void); 205static void setup(void);
206static void seturgent(Client *c, int urg);
207static void showhide(Client *c); 207static void showhide(Client *c);
208static void sigchld(int unused); 208static void sigchld(int unused);
209static void spawn(const Arg *arg); 209static void spawn(const Arg *arg);
@@ -509,19 +509,6 @@ cleanupmon(Monitor *mon)
509} 509}
510 510
511void 511void
512clearurgent(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
524void
525clientmessage(XEvent *e) 512clientmessage(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
1604void
1605seturgent(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
1619void 1617void
1620showhide(Client *c) 1618showhide(Client *c)
1621{ 1619{