[hackers] [dwm] applied Hiltjo's cleanup patch || Anselm R Garbe

From: <hg_AT_suckless.org>
Date: Fri, 19 Nov 2010 11:54:01 +0000 (UTC)

changeset: 1528:b4f5309d6253
tag: tip
user: Anselm R Garbe <anselm_AT_garbe.us>
date: Fri Nov 19 11:53:59 2010 +0000
files: dwm.c
description:
applied Hiltjo's cleanup patch

diff -r 406003e3a01f -r b4f5309d6253 dwm.c
--- a/dwm.c Mon Sep 27 07:53:44 2010 +0000
+++ b/dwm.c Fri Nov 19 11:53:59 2010 +0000
@@ -267,7 +267,6 @@
         [UnmapNotify] = unmapnotify
 };
 static Atom wmatom[WMLast], netatom[NetLast];
-static Bool otherwm;
 static Bool running = True;
 static Cursor cursor[CurLast];
 static Display *dpy;
@@ -458,13 +457,10 @@
 
 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);
 }
@@ -994,12 +990,11 @@
                 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);
@@ -1088,14 +1083,12 @@
 
 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))) {
@@ -1579,7 +1572,6 @@
         }
 }
 
-
 void
 sigchld(int unused) {
         if(signal(SIGCHLD, sigchld) == SIG_ERR)
@@ -2015,7 +2007,7 @@
  * is already running. */
 int
 xerrorstart(Display *dpy, XErrorEvent *ee) {
- otherwm = True;
+ die("dwm: another window manager is already running\n");
         return -1;
 }
 
Received on Fri Nov 19 2010 - 12:54:01 CET

This archive was generated by hypermail 2.2.0 : Fri Nov 19 2010 - 13:00:09 CET