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:
committed by
Michael Stapelberg
parent
715983024d
commit
614b360bd4
@ -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, we’re 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")) {
|
||||
|
Reference in New Issue
Block a user