GApplication: Add a way to replace a unique instance

While uniqueness is great, sometimes you want to restart
a newer version of the same app. These two flags make that
possible.

We also add a ::name-lost signal, that is emitted when it
happens. The default handler for this signal just calls
g_application_quit(), but applications may want to connect
and do cleanup or state-saving here.
This commit is contained in:
Matthias Clasen
2018-08-18 15:35:33 -04:00
parent 051c9ada8e
commit 3a4b18f903
4 changed files with 117 additions and 7 deletions

View File

@@ -112,9 +112,10 @@ struct _GApplicationClass
const gchar *object_path);
gint (* handle_local_options)(GApplication *application,
GVariantDict *options);
gboolean (* name_lost) (GApplication *application);
/*< private >*/
gpointer padding[8];
gpointer padding[7];
};
GLIB_AVAILABLE_IN_ALL