cvsimport
* refs/heads/master: Fixed memory leak in xu_get_strprop. Prevent out of boundary write with configuration files in which too many quoted arguments are stored for other window managers. Allow configuring a percentage window size of the master window during htile/vtile actions. From Uwe Werler, with a few manpage tweaks. zap stray tabs Instead of using _NET_ACTIVE_WINDOW on restart, use the pointer location to determine what client to set active. Reduces a round trip for every window. Add support for SIGINT/SIGTERM. Simplify conditional construct. Trim event_mask to those that the root window actually needs. No need to lookup current client early; move to right before it is needed. Recommit 1.259, but now with TAILQ_FOREACH_SAFE. Revert previous. Causes a crash as reported by Tom Murphy. Simplify list markup. Plug two memory leaks. Also get rid of a variable that is no longer necessary. Remove ColormaskChange from event-mask since there's no event handler. Unrelated style fixes, consistency changes and sorting, appropriate dosage/removal of wrappers, simplification of name queue, client cycle joins other kb/mb bound functions.
This commit is contained in:
22
calmwm.c
22
calmwm.c
@@ -44,6 +44,7 @@ struct screen_q Screenq = TAILQ_HEAD_INITIALIZER(Screenq);
|
||||
struct conf Conf;
|
||||
volatile sig_atomic_t cwm_status;
|
||||
|
||||
__dead void usage(void);
|
||||
static void sighdlr(int);
|
||||
static int x_errorhandler(Display *, XErrorEvent *);
|
||||
static int x_init(const char *);
|
||||
@@ -88,11 +89,12 @@ main(int argc, char **argv)
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (signal(SIGCHLD, sighdlr) == SIG_ERR)
|
||||
if (signal(SIGCHLD, sighdlr) == SIG_ERR ||
|
||||
signal(SIGHUP, sighdlr) == SIG_ERR ||
|
||||
signal(SIGINT, sighdlr) == SIG_ERR ||
|
||||
signal(SIGTERM, sighdlr) == SIG_ERR)
|
||||
err(1, "signal");
|
||||
if (signal(SIGHUP, sighdlr) == SIG_ERR)
|
||||
err(1, "signal");
|
||||
|
||||
|
||||
if (parse_config(Conf.conf_file, &Conf) == -1) {
|
||||
warnx("error parsing config file");
|
||||
if (nflag)
|
||||
@@ -126,7 +128,7 @@ main(int argc, char **argv)
|
||||
u_exec(fallback);
|
||||
}
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -144,7 +146,7 @@ x_init(const char *dpyname)
|
||||
|
||||
Conf.xrandr = XRRQueryExtension(X_Dpy, &Conf.xrandr_event_base, &i);
|
||||
|
||||
conf_atoms();
|
||||
xu_atom_init();
|
||||
conf_cursor(&Conf);
|
||||
|
||||
for (i = 0; i < ScreenCount(X_Dpy); i++)
|
||||
@@ -182,7 +184,7 @@ static int
|
||||
x_wmerrorhandler(Display *dpy, XErrorEvent *e)
|
||||
{
|
||||
errx(1, "root window unavailable - perhaps another wm is running?");
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -198,7 +200,7 @@ x_errorhandler(Display *dpy, XErrorEvent *e)
|
||||
|
||||
warnx("%s(0x%x): %s", req, (unsigned int)e->resourceid, msg);
|
||||
#endif
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -217,6 +219,10 @@ sighdlr(int sig)
|
||||
case SIGHUP:
|
||||
cwm_status = CWM_EXEC_WM;
|
||||
break;
|
||||
case SIGINT:
|
||||
case SIGTERM:
|
||||
cwm_status = CWM_QUIT;
|
||||
break;
|
||||
}
|
||||
|
||||
errno = save_errno;
|
||||
|
||||
Reference in New Issue
Block a user