Implement kill-command to kill the current window, document it

This commit is contained in:
Michael Stapelberg
2009-03-14 22:09:36 +01:00
parent cc0b060628
commit cb9c7078be
9 changed files with 86 additions and 4 deletions

View File

@ -560,8 +560,10 @@ void parse_command(xcb_connection_t *conn, const char *command) {
}
/* Is it an <exit>? */
if (STARTS_WITH(command, "exit"))
exit(0);
if (STARTS_WITH(command, "exit")) {
LOG("User issued exit-command, exiting without error.\n");
exit(EXIT_SUCCESS);
}
/* Is it <restart>? Then restart in place. */
if (STARTS_WITH(command, "restart")) {
@ -570,6 +572,17 @@ void parse_command(xcb_connection_t *conn, const char *command) {
/* not reached */
}
if (STARTS_WITH(command, "kill")) {
if (CUR_CELL->currently_focused == NULL) {
LOG("There is no window to kill\n");
return;
}
LOG("Killing current window\n");
kill_window(conn, CUR_CELL->currently_focused);
return;
}
/* Is it 'f' for fullscreen? */
if (command[0] == 'f') {
if (CUR_CELL->currently_focused == NULL)