mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 04:40:25 +01:00
tools: handle sigint in debug-gui
Exit with success on SIGINT Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
5685980437
commit
22890a4719
1 changed files with 11 additions and 0 deletions
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib.h>
|
||||
#include <glib-unix.h>
|
||||
|
||||
#include <libinput.h>
|
||||
#include <libinput-util.h>
|
||||
|
|
@ -918,6 +919,14 @@ usage(void) {
|
|||
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)
|
||||
{
|
||||
|
|
@ -930,6 +939,8 @@ main(int argc, char **argv)
|
|||
|
||||
gtk_init(&argc, &argv);
|
||||
|
||||
g_unix_signal_add(SIGINT, signal_handler, NULL);
|
||||
|
||||
tools_init_options(&options);
|
||||
|
||||
while (1) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue