guint is_remote : 1;
guint did_startup : 1;
guint did_shutdown : 1;
+ guint must_quit_now : 1;
GRemoteActionGroup *remote_actions;
GApplicationImpl *impl;
g_return_val_if_fail (G_IS_APPLICATION (application), 1);
g_return_val_if_fail (argc == 0 || argv != NULL, 1);
+ g_return_val_if_fail (!application->priv->must_quit_now, 1);
arguments = g_new (gchar *, argc + 1);
for (i = 0; i < argc; i++)
while (application->priv->use_count || application->priv->inactivity_timeout_id)
{
+ if (application->priv->must_quit_now)
+ break;
+
g_main_context_iteration (NULL, TRUE);
status = 0;
}
default_app = application;
}
+/**
+ * g_application_quit:
+ * @application: a #GApplication
+ *
+ * Immediately quits the application.
+ *
+ * Upon return to the mainloop, g_application_run() will return,
+ * calling only the 'shutdown' function before doing so.
+ *
+ * The hold count is ignored.
+ *
+ * The result of calling g_application_run() again after it returns is
+ * unspecified.
+ *
+ * Since: 2.32
+ **/
+void
+g_application_quit (GApplication *application)
+{
+ g_return_if_fail (G_IS_APPLICATION (application));
+
+ application->priv->must_quit_now = TRUE;
+}
+
/* Epilogue {{{1 */
/* vim:set foldmethod=marker: */
g_application_set_default
g_application_set_flags
g_application_set_inactivity_timeout
+g_application_quit
g_application_command_line_get_arguments
g_application_command_line_get_cwd
g_application_command_line_get_environ