mirror of
https://github.com/elementary/gala.git
synced 2024-11-23 11:02:18 +03:00
parent
0dd3663ed3
commit
9d6f980d19
@ -42,7 +42,27 @@ namespace Gala {
|
|||||||
return Posix.EXIT_FAILURE;
|
return Posix.EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Intercept signals */
|
||||||
ctx.set_plugin_gtype (typeof (WindowManagerGala));
|
ctx.set_plugin_gtype (typeof (WindowManagerGala));
|
||||||
|
Posix.sigset_t empty_mask;
|
||||||
|
Posix.sigemptyset (out empty_mask);
|
||||||
|
Posix.sigaction_t act = {};
|
||||||
|
act.sa_handler = Posix.SIG_IGN;
|
||||||
|
act.sa_mask = empty_mask;
|
||||||
|
act.sa_flags = 0;
|
||||||
|
|
||||||
|
if (Posix.sigaction (Posix.SIGPIPE, act, null) < 0) {
|
||||||
|
warning ("Failed to register SIGPIPE handler: %s", GLib.strerror (GLib.errno));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Posix.sigaction (Posix.SIGXFSZ, act, null) < 0) {
|
||||||
|
warning ("Failed to register SIGXFSZ handler: %s", GLib.strerror (GLib.errno));
|
||||||
|
}
|
||||||
|
|
||||||
|
GLib.Unix.signal_add (Posix.SIGTERM, () => {
|
||||||
|
ctx.terminate ();
|
||||||
|
return GLib.Source.REMOVE;
|
||||||
|
});
|
||||||
#else
|
#else
|
||||||
unowned OptionContext ctx = Meta.get_option_context ();
|
unowned OptionContext ctx = Meta.get_option_context ();
|
||||||
ctx.add_main_entries (Gala.OPTIONS, null);
|
ctx.add_main_entries (Gala.OPTIONS, null);
|
||||||
|
Loading…
Reference in New Issue
Block a user