summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2021-07-02 17:18:51 +0200
committerJonas Ådahl <jadahl@gmail.com>2021-07-15 13:40:34 +0200
commit8a4aa92a5406212225b359c3d2f99f3f8f84e17e (patch)
tree096da7d8fd025c5c716f3375c2dbcb4c05f700cd /src/core
parent9cda0bd7198d301c0c5fac1f5897418b9b5194c3 (diff)
downloadmutter-8a4aa92a5406212225b359c3d2f99f3f8f84e17e.tar.gz
context: Move the signal handling and dir management to user
Signals and changing current directory is a process global action, thus isn't that suitable for a library. Thus, move that responsibility to gnome-shell. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1861>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/meta-context.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/core/meta-context.c b/src/core/meta-context.c
index 291cdbd32..7bb0e5f46 100644
--- a/src/core/meta-context.c
+++ b/src/core/meta-context.c
@@ -22,7 +22,6 @@
#include "core/meta-context-private.h"
-#include <glib-unix.h>
#include <locale.h>
#include "backends/meta-backend-private.h"
@@ -277,49 +276,6 @@ meta_context_configure (MetaContext *context,
return TRUE;
}
-static gboolean
-on_sigterm (gpointer user_data)
-{
- MetaContext *context = META_CONTEXT (user_data);
-
- meta_context_terminate (context);
-
- return G_SOURCE_REMOVE;
-}
-
-static void
-init_signal_handlers (MetaContext *context)
-{
- struct sigaction act = { 0 };
- sigset_t empty_mask;
-
- sigemptyset (&empty_mask);
- act.sa_handler = SIG_IGN;
- act.sa_mask = empty_mask;
- act.sa_flags = 0;
- if (sigaction (SIGPIPE, &act, NULL) < 0)
- g_warning ("Failed to register SIGPIPE handler: %s", g_strerror (errno));
-#ifdef SIGXFSZ
- if (sigaction (SIGXFSZ, &act, NULL) < 0)
- g_warning ("Failed to register SIGXFSZ handler: %s", g_strerror (errno));
-#endif
-
- g_unix_signal_add (SIGTERM, on_sigterm, context);
-}
-
-static void
-change_to_home_directory (void)
-{
- const char *home_dir;
-
- home_dir = g_get_home_dir ();
- if (!home_dir)
- return;
-
- if (chdir (home_dir) < 0)
- g_warning ("Could not change to home directory %s", home_dir);
-}
-
static const char *
compositor_type_to_description (MetaCompositorType compositor_type)
{
@@ -375,9 +331,6 @@ meta_context_setup (MetaContext *context,
}
meta_init_debug_utils ();
- init_signal_handlers (context);
-
- change_to_home_directory ();
compositor_type = meta_context_get_compositor_type (context);
g_message ("Running %s (using mutter %s) as a %s",