added popup for handling SIGSEGV or SIGFPE

the popup is placed on each of the virtual screens
the user can decide to restart or quit i3
in case of an exit a core-dump is generated
This commit is contained in:
Jan-Erik Rediger
2010-01-03 14:52:38 +01:00
committed by Michael Stapelberg
parent 715983024d
commit 614b360bd4
6 changed files with 300 additions and 45 deletions

@ -31,6 +31,7 @@
#include "commands.h"
#include "resize.h"
#include "log.h"
#include "sighandler.h"
bool focus_window_in_container(xcb_connection_t *conn, Container *container, direction_t direction) {
/* If this container is empty, were done */
@ -759,29 +760,6 @@ static void travel_focus_stack(xcb_connection_t *conn, const char *arguments) {
}
}
/*
* Goes through the list of arguments (for exec()) and checks if the given argument
* is present. If not, it copies the arguments (because we cannot realloc it) and
* appends the given argument.
*
*/
static char **append_argument(char **original, char *argument) {
int num_args;
for (num_args = 0; original[num_args] != NULL; num_args++) {
DLOG("original argument: \"%s\"\n", original[num_args]);
/* If the argument is already present we return the original pointer */
if (strcmp(original[num_args], argument) == 0)
return original;
}
/* Copy the original array */
char **result = smalloc((num_args+2) * sizeof(char*));
memcpy(result, original, num_args * sizeof(char*));
result[num_args] = argument;
result[num_args+1] = NULL;
return result;
}
/*
* Switch to next or previous existing workspace
*
@ -965,12 +943,7 @@ void parse_command(xcb_connection_t *conn, const char *command) {
/* Is it <restart>? Then restart in place. */
if (STARTS_WITH(command, "restart")) {
LOG("restarting \"%s\"...\n", start_argv[0]);
/* make sure -a is in the argument list or append it */
start_argv = append_argument(start_argv, "-a");
execvp(start_argv[0], start_argv);
/* not reached */
i3_restart();
}
if (STARTS_WITH(command, "kill")) {