Just quit when the connection is closed

This commit is contained in:
Bastien Dejean 2013-12-23 20:39:14 +01:00
parent a090902140
commit 986825a118
3 changed files with 5 additions and 9 deletions

11
bspwm.c
View file

@ -176,8 +176,10 @@ int main(int argc, char *argv[])
}
}
if (xcb_connection_has_error(dpy))
err("The server has closed the connection.\n");
if (xcb_connection_has_error(dpy)) {
warn("The server closed the connection.\n");
running = false;
}
}
cleanup();
@ -314,11 +316,6 @@ void register_events(void)
}
}
void quit(void)
{
running = false;
}
void cleanup(void)
{
while (mon_head != NULL)

View file

@ -76,7 +76,6 @@ bool randr;
void init(void);
void setup(void);
void register_events(void);
void quit(void);
void cleanup(void);
void put_status(void);
void sig_handler(int sig);

View file

@ -844,7 +844,7 @@ bool cmd_quit(char **args, int num)
{
if (num > 0 && sscanf(*args, "%i", &exit_status) != 1)
return false;
quit();
running = false;
return true;
}