summaryrefslogtreecommitdiff
path: root/gtk/gtkapplication.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-01-21 20:45:15 -0500
committerMatthias Clasen <mclasen@redhat.com>2019-02-19 00:56:31 -0500
commitd006ee65f5b064a3edc15910fad1ba309d9468b2 (patch)
tree36936d5cc5cfd66be00e5022b83e2469280f6b0e /gtk/gtkapplication.c
parent65e9d71da56de9802d04bd94cf6e52b764bdf91b (diff)
downloadgtk+-d006ee65f5b064a3edc15910fad1ba309d9468b2.tar.gz
application: Add a query-end signal
This lets us take just-in-time inhibitors, and makes the session support a little more real.
Diffstat (limited to 'gtk/gtkapplication.c')
-rw-r--r--gtk/gtkapplication.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index 0ae1de11a1..7adfc70f03 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -129,6 +129,7 @@
enum {
WINDOW_ADDED,
WINDOW_REMOVED,
+ QUERY_END,
LAST_SIGNAL
};
@@ -654,6 +655,22 @@ gtk_application_class_init (GtkApplicationClass *class)
G_TYPE_NONE, 1, GTK_TYPE_WINDOW);
/**
+ * GtkApplication::query-end:
+ * @application: the #GtkApplication which emitted the signal
+ *
+ * Emitted when the session manager is about to end the session, only
+ * if #GtkApplication::register-session is %TRUE. Applications can
+ * connect to this signal and call gtk_application_inhibit() with
+ * %GTK_APPLICATION_INHIBIT_LOGOUT to delay the end of the session
+ * until state has been saved.
+ */
+ gtk_application_signals[QUERY_END] =
+ g_signal_new (I_("query-end"), GTK_TYPE_APPLICATION, G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL, NULL,
+ NULL,
+ G_TYPE_NONE, 0);
+ /**
* GtkApplication:register-session:
*
* Set this property to %TRUE to register with the session manager.