static void setmfact(const Arg *arg);
static void setup(void);
static void showhide(Client *c);
-static void sigchld(int signal);
+static void sigchld(int unused);
static void spawn(const Arg *arg);
static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
/* adjust for aspect limits */
if(c->mina > 0 && c->maxa > 0) {
if(c->maxa < (float)*w / *h)
- *w = *h * c->maxa + 0.5; /* -Os double upcast workaround */
+ *w = *h * c->maxa + 0.5;
else if(c->mina < (float)*h / *w)
- *h = *w * c->mina + 0.5; /* -Os double upcast workaround */
+ *h = *w * c->mina + 0.5;
}
if(baseismin) { /* increment calculation requires this */
*w -= c->basew;
int w;
XSetWindowAttributes wa;
+ /* clean up any zombies immediately */
+ signal(SIGCHLD, sigchld);
+ sigchld(0);
+
/* init screen */
screen = DefaultScreen(dpy);
root = RootWindow(dpy, screen);
void
-sigchld(int signal) {
+sigchld(int unused) {
while(0 < waitpid(-1, NULL, WNOHANG));
+ signal(SIGCHLD, sigchld);
}
void
spawn(const Arg *arg) {
- signal(SIGCHLD, sigchld);
if(fork() == 0) {
if(dpy)
close(ConnectionNumber(dpy));
Monitor *newmons = NULL, *m = NULL, *tm;
#ifdef XINERAMA
+ int nn;
XineramaScreenInfo *info = NULL;
if(XineramaIsActive(dpy))
info = XineramaQueryScreens(dpy, &n);
+ for(i = 1, nn = n; i < n; i++)
+ if(info[i - 1].x_org == info[i].x_org && info[i - 1].y_org == info[i].y_org
+ && info[i - 1].width == info[i].width && info[i - 1].height == info[i].height)
+ --nn;
+ n = nn; /* we only consider unique geometries as separate screens */
#endif /* XINERAMA */
/* allocate monitor(s) for the new geometry setup */
for(i = 0; i < n; i++) {