[UnmapNotify] = unmapnotify
};
static Atom wmatom[WMLast], netatom[NetLast];
-static Bool otherwm;
static Bool running = True;
static Cursor cursor[CurLast];
static Display *dpy;
void
checkotherwm(void) {
- otherwm = False;
xerrorxlib = XSetErrorHandler(xerrorstart);
/* this causes an error if some other window manager is running */
XSelectInput(dpy, DefaultRootWindow(dpy), SubstructureRedirectMask);
XSync(dpy, False);
- if(otherwm)
- die("dwm: another window manager is already running\n");
XSetErrorHandler(xerror);
XSync(dpy, False);
}
XFreeStringList(missing);
}
if(dc.font.set) {
- XFontSetExtents *font_extents;
XFontStruct **xfonts;
char **font_names;
dc.font.ascent = dc.font.descent = 0;
- font_extents = XExtentsOfFontSet(dc.font.set);
+ XExtentsOfFontSet(dc.font.set);
n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);
for(i = 0, dc.font.ascent = 0, dc.font.descent = 0; i < n; i++) {
dc.font.ascent = MAX(dc.font.ascent, (*xfonts)->ascent);
void
manage(Window w, XWindowAttributes *wa) {
- static Client cz;
Client *c, *t = NULL;
Window trans = None;
XWindowChanges wc;
- if(!(c = malloc(sizeof(Client))))
+ if(!(c = calloc(1, sizeof(Client))))
die("fatal: could not malloc() %u bytes\n", sizeof(Client));
- *c = cz;
c->win = w;
updatetitle(c);
if(XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
}
}
-
void
sigchld(int unused) {
if(signal(SIGCHLD, sigchld) == SIG_ERR)
* is already running. */
int
xerrorstart(Display *dpy, XErrorEvent *ee) {
- otherwm = True;
+ die("dwm: another window manager is already running\n");
return -1;
}