diff --git a/src/Application.vala b/src/Application.vala index 76f0f57..1f195cd 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -104,14 +104,9 @@ public class Badger.Application : Gtk.Application { public override int command_line (ApplicationCommandLine command_line) { stdout.printf ("\n💲️ Command line mode started"); - OptionEntry[] options = new OptionEntry[2]; - options[0] = { - "headless", 0, 0, OptionArg.NONE, - ref headless, "Run without window", null - }; - options[1] = { - "request-autostart", 0, 0, OptionArg.NONE, - ref ask_autostart, "Request autostart permission", null + OptionEntry[] options = { + {"request-autostart", 'r', 0, OptionArg.NONE, ref ask_autostart, "Request autostart permission", null}, + {"headless", 'h', 0, OptionArg.NONE, ref headless, "Run without window", null}, }; // We have to make an extra copy of the array, since .parse assumes diff --git a/src/MainWindow.vala b/src/MainWindow.vala index a329344..de927a8 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -33,6 +33,7 @@ public class Badger.MainWindow : Gtk.Window { construct { Intl.setlocale (); + hide_on_close = true; settings = new GLib.Settings ("com.github.elfenware.badger.timers"); // We cannot resize window if it is allowed to change @@ -72,11 +73,11 @@ public class Badger.MainWindow : Gtk.Window { } private void on_toggle_changed () { - debug ("\nToggle changed!"); + debug ("Toggle changed!"); main.revealer.reveal_child = settings.get_boolean ("all"); if (!settings.get_boolean ("all")) { - debug ("\nToggle is off! Resizing window"); + debug ("Toggle is off! Resizing window"); set_size_request (12, 12); queue_resize (); } @@ -84,7 +85,6 @@ public class Badger.MainWindow : Gtk.Window { // Avoid a bug whence reopened windows cannot be closed private bool before_destroy () { - hide (); - return true; + return false; } }