aboutsummaryrefslogtreecommitdiff
path: root/monsterwm.c
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2012-03-01 19:36:35 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2012-12-16 02:11:13 +0200
commitd93a13f4261d4ab183715cc6157a72ac1187ead9 (patch)
tree31db2e29c3980b155bebdb5e6fb17ce5c700b7aa /monsterwm.c
parent946c57212c5456786306525f59c479a8a357a7de (diff)
exit with specified value
Diffstat (limited to 'monsterwm.c')
-rw-r--r--monsterwm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/monsterwm.c b/monsterwm.c
index 428a311..bb1795e 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -88,7 +88,7 @@ static void moveresize(const Arg *arg);
static void mousemotion(const Arg *arg);
static void next_win();
static void prev_win();
-static void quit();
+static void quit(const Arg *arg);
static void spawn(const Arg *arg);
static void swap_master();
static void switch_mode(const Arg *arg);
@@ -178,7 +178,7 @@ static int xerrorstart(Display *dis, XErrorEvent *ee);
* currdeskidx - which desktop is currently active
*/
static Bool running = True;
-static int wh, ww, currdeskidx, prevdeskidx;
+static int wh, ww, currdeskidx, prevdeskidx, retval;
static unsigned int numlockmask, win_unfocus, win_focus;
static Display *dis;
static Window root;
@@ -905,7 +905,8 @@ void propertynotify(XEvent *e) {
* to quit just stop receiving events
* run is stopped and control is back to main
*/
-void quit(void) {
+void quit(const Arg *arg) {
+ retval = arg->i;
running = False;
}
@@ -1161,7 +1162,7 @@ int main(int argc, char *argv[]) {
run();
cleanup();
XCloseDisplay(dis);
- return 0;
+ return retval;
}
/* vim: set expandtab ts=4 sts=4 sw=4 : */