From 79bbde8766f3cefdb1f5df001dcdb4223b2d421a Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 28 Jan 2011 00:31:26 +0100 Subject: [PATCH] add a flag to disable the signalhandler --- src/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 */ -- 2.39.5