|
|
|
@@ -138,7 +138,7 @@ static void attachstack(Client *c);
|
|
|
|
|
static void buttonpress(XEvent *e);
|
|
|
|
|
static void checkotherwm(void);
|
|
|
|
|
static void cleanup(void);
|
|
|
|
|
static void clearurgent(void);
|
|
|
|
|
static void clearurgent(Client *c);
|
|
|
|
|
static void configure(Client *c);
|
|
|
|
|
static void configurenotify(XEvent *e);
|
|
|
|
|
static void configurerequest(XEvent *e);
|
|
|
|
@@ -182,7 +182,6 @@ static void setlayout(const Arg *arg);
|
|
|
|
|
static void setmfact(const Arg *arg);
|
|
|
|
|
static void setup(void);
|
|
|
|
|
static void showhide(Client *c);
|
|
|
|
|
static void sigchld(int signal);
|
|
|
|
|
static void spawn(const Arg *arg);
|
|
|
|
|
static void tag(const Arg *arg);
|
|
|
|
|
static int textnw(const char *text, unsigned int len);
|
|
|
|
@@ -366,20 +365,15 @@ cleanup(void) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
clearurgent(void) {
|
|
|
|
|
clearurgent(Client *c) {
|
|
|
|
|
XWMHints *wmh;
|
|
|
|
|
Client *c;
|
|
|
|
|
|
|
|
|
|
for(c = clients; c; c = c->next)
|
|
|
|
|
if(ISVISIBLE(c) && c->isurgent) {
|
|
|
|
|
c->isurgent = False;
|
|
|
|
|
if (!(wmh = XGetWMHints(dpy, c->win)))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if(!(wmh = XGetWMHints(dpy, c->win)))
|
|
|
|
|
return;
|
|
|
|
|
wmh->flags &= ~XUrgencyHint;
|
|
|
|
|
XSetWMHints(dpy, c->win, wmh);
|
|
|
|
|
XFree(wmh);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@@ -618,6 +612,8 @@ focus(Client *c) {
|
|
|
|
|
XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
|
|
|
|
|
}
|
|
|
|
|
if(c) {
|
|
|
|
|
if(c->isurgent)
|
|
|
|
|
clearurgent(c);
|
|
|
|
|
detachstack(c);
|
|
|
|
|
attachstack(c);
|
|
|
|
|
grabbuttons(c, True);
|
|
|
|
@@ -1392,15 +1388,11 @@ showhide(Client *c) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sigchld(int signal) {
|
|
|
|
|
while(0 < waitpid(-1, NULL, WNOHANG));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
spawn(const Arg *arg) {
|
|
|
|
|
signal(SIGCHLD, sigchld);
|
|
|
|
|
/* The double-fork construct avoids zombie processes and keeps the code
|
|
|
|
|
* clean from stupid signal handlers. */
|
|
|
|
|
if(fork() == 0) {
|
|
|
|
|
if(fork() == 0) {
|
|
|
|
|
if(dpy)
|
|
|
|
|
close(ConnectionNumber(dpy));
|
|
|
|
@@ -1408,8 +1400,10 @@ spawn(const Arg *arg) {
|
|
|
|
|
execvp(((char **)arg->v)[0], (char **)arg->v);
|
|
|
|
|
fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]);
|
|
|
|
|
perror(" failed");
|
|
|
|
|
}
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
wait(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@@ -1503,7 +1497,6 @@ toggleview(const Arg *arg) {
|
|
|
|
|
|
|
|
|
|
if(mask) {
|
|
|
|
|
tagset[seltags] = mask;
|
|
|
|
|
clearurgent();
|
|
|
|
|
arrange();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -1676,7 +1669,6 @@ view(const Arg *arg) {
|
|
|
|
|
seltags ^= 1; /* toggle sel tagset */
|
|
|
|
|
if(arg->ui & TAGMASK)
|
|
|
|
|
tagset[seltags] = arg->ui & TAGMASK;
|
|
|
|
|
clearurgent();
|
|
|
|
|
arrange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|