Exit with success on SIGINT
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
#include <gtk/gtk.h>
#include <glib.h>
+#include <glib-unix.h>
#include <libinput.h>
#include <libinput-util.h>
printf("Usage: libinput debug-gui [options] [--udev <seat>|--device /dev/input/event0]\n");
}
+static gboolean
+signal_handler(void *data)
+{
+ gtk_main_quit();
+
+ return FALSE;
+}
+
int
main(int argc, char **argv)
{
gtk_init(&argc, &argv);
+ g_unix_signal_add(SIGINT, signal_handler, NULL);
+
tools_init_options(&options);
while (1) {