From: Michael Stapelberg Date: Thu, 27 Jan 2011 23:31:26 +0000 (+0100) Subject: add a flag to disable the signalhandler X-Git-Tag: tree-pr2~88 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=79bbde8766f3cefdb1f5df001dcdb4223b2d421a;p=i3%2Fi3 add a flag to disable the signalhandler --- diff --git a/src/main.c b/src/main.c index 5736324f..27603357 100644 --- a/src/main.c +++ b/src/main.c @@ -148,6 +148,7 @@ int main(int argc, char *argv[]) { bool delete_layout_path; bool only_check_config = false; bool force_xinerama = false; + bool disable_signalhandler = false; xcb_intern_atom_cookie_t atom_cookies[NUM_ATOMS]; static struct option long_options[] = { {"no-autostart", no_argument, 0, 'a'}, @@ -157,6 +158,7 @@ int main(int argc, char *argv[]) { {"layout", required_argument, 0, 'L'}, {"restart", required_argument, 0, 0}, {"force-xinerama", no_argument, 0, 0}, + {"disable-signalhandler", no_argument, 0, 0}, {0, 0, 0, 0} }; int option_index = 0, opt; @@ -189,7 +191,7 @@ int main(int argc, char *argv[]) { only_check_config = true; break; case 'v': - printf("i3 version " I3_VERSION " © 2009 Michael Stapelberg and contributors\n"); + printf("i3 version " I3_VERSION " © 2009-2011 Michael Stapelberg and contributors\n"); exit(EXIT_SUCCESS); case 'V': set_verbosity(true); @@ -210,6 +212,9 @@ int main(int argc, char *argv[]) { "Please check if your driver really does not support RandR " "and disable this option as soon as you can.\n"); break; + } else if (strcmp(long_options[option_index].name, "disable-signalhandler") == 0) { + disable_signalhandler = true; + break; } else if (strcmp(long_options[option_index].name, "restart") == 0) { FREE(layout_path); layout_path = sstrdup(optarg); @@ -494,7 +499,8 @@ int main(int argc, char *argv[]) { manage_existing_windows(root); - setup_signal_handler(); + if (!disable_signalhandler) + setup_signal_handler(); /* Ignore SIGPIPE to survive errors when an IPC client disconnects * while we are sending him a message */