#include <glib.h>
#include <stdlib.h>
+#include <signal.h>
#include "tilda.h"
#include "tilda-window.h"
}
}
+static void
+tilda_termination_handler (gint signum)
+{
+ debug_enter ();
+ debug_printf ("signum: %d\n", signum);
+
+ gtk_main_quit ();
+}
+
+/* Hook up all system signal handlers */
+static void
+tilda_signal_handlers_init ()
+{
+ struct sigaction sa;
+
+ /* Hook up signal handlers */
+ sa.sa_handler = tilda_termination_handler;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = 0;
+
+ sigaction (SIGINT, &sa, NULL);
+ sigaction (SIGQUIT, &sa, NULL);
+ sigaction (SIGABRT, &sa, NULL);
+ sigaction (SIGTERM, &sa, NULL);
+ sigaction (SIGKILL, &sa, NULL);
+}
+
int main (int argc, char *argv[])
{
debug_enter ();
/* Initialize GTK+ (and the GObject system) */
gtk_init (&argc, &argv);
+ /* Hook up the signal handlers */
+ tilda_signal_handlers_init ();
+
/* Initialize the keybinder */
tomboy_keybinder_init ();