[metacity/wip/muktupavels/issue-21: 2/2] main: add SIGINT handler




commit 39cf903c72de7577ffa868739167a82c02e0286f
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Jul 19 18:58:48 2021 +0300

    main: add SIGINT handler
    
    https://gitlab.gnome.org/GNOME/metacity/-/issues/21

 src/core/main.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/core/main.c b/src/core/main.c
index e3f260b5..794341af 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -409,6 +409,13 @@ sigterm_cb (gpointer user_data)
   return G_SOURCE_REMOVE;
 }
 
+static gboolean
+sigint_cb (gpointer user_data)
+{
+  meta_quit ();
+  return G_SOURCE_REMOVE;
+}
+
 /**
  * This is where the story begins. It parses commandline options and
  * environment variables, sets up the screen, hands control off to
@@ -445,6 +452,7 @@ main (int argc, char **argv)
 #endif
 
   g_unix_signal_add (SIGTERM, sigterm_cb, NULL);
+  g_unix_signal_add (SIGINT, sigint_cb, NULL);
 
   meta_init_debug ();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]