From 404829631414d1ee316d9891cf4ade20641fe8b0 Mon Sep 17 00:00:00 2001 From: Akbar Hashmi Date: Tue, 19 Dec 2017 07:04:51 +0530 Subject: [PATCH] application: Add --quit commandline argument Overview: Clicking the close button in gnome-calendar doesn't always close all the instances of the application. The window is closed, but an instance of gnome-calendar is still running as a gapplication-service, which was probably run by gnome-shell search provider. The two changes made were as follows: 1) added the argument quit to GOptionEntry 2) added the definition of quit to gcal_application_command_line --- src/gcal-application.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gcal-application.c b/src/gcal-application.c index eea4ea11..30d6e2df 100644 --- a/src/gcal-application.c +++ b/src/gcal-application.c @@ -84,6 +84,11 @@ G_DEFINE_TYPE (GcalApplication, gcal_application, GTK_TYPE_APPLICATION); static gboolean show_version = FALSE; static GOptionEntry gcal_application_goptions[] = { + { + "quit", 'q', 0, + G_OPTION_ARG_NONE, NULL, + N_("Quit GNOME Calendar"), NULL + }, { "version", 'v', 0, G_OPTION_ARG_NONE, &show_version, @@ -297,6 +302,12 @@ gcal_application_command_line (GApplication *app, self = GCAL_APPLICATION (app); options = g_application_command_line_get_options_dict (command_line); + if (g_variant_dict_contains (options, "quit")) + { + g_application_quit (app); + return 0; + } + if (g_variant_dict_contains (options, "debug")) gcal_log_init ();