diff options
author | Aylur <[email protected]> | 2024-07-31 16:25:04 +0200 |
---|---|---|
committer | Aylur <[email protected]> | 2024-07-31 16:25:04 +0200 |
commit | a0680e3b88c767da23186648024a5b05c4a2f013 (patch) | |
tree | 5dde966f23ecba2a438b633fba62f4e112c7763f /src | |
parent | f86a908952c5ae34a0e2ac832ffe43cb4d0ae0cc (diff) |
feat: optiona exit code on App.quit
Diffstat (limited to 'src')
-rw-r--r-- | src/astal.vala | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/astal.vala b/src/astal.vala index 3ed705d..6868a7e 100644 --- a/src/astal.vala +++ b/src/astal.vala @@ -192,11 +192,11 @@ public class Application : Gtk.Application { } } - construct { + public new void quit() throws DBusError, IOError { if (instance_name == null) instance_name = "astal"; - shutdown.connect(() => { + if (service != null) { if (FileUtils.test(socket_path, GLib.FileTest.EXISTS)){ try { File.new_for_path(socket_path).delete(null); @@ -204,17 +204,18 @@ public class Application : Gtk.Application { warning(err.message); } } - }); + } + + base.quit(); + } + construct { + shutdown.connect(() => { try { quit(); } catch(Error err) {} }); Unix.signal_add(1, () => { try { quit(); } catch(Error err) {} }, Priority.HIGH); Unix.signal_add(2, () => { try { quit(); } catch(Error err) {} }, Priority.HIGH); Unix.signal_add(15, () => { try { quit(); } catch(Error err) {} }, Priority.HIGH); } - public new void quit() throws DBusError, IOError { - base.quit(); - } - public static List<string> get_instances() { var list = new List<string>(); var prefix = "io.Astal."; |