summaryrefslogtreecommitdiff
path: root/gio/gnotification.c
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2022-11-15 17:48:47 +0000
committerPhilip Withnall <pwithnall@endlessos.org>2022-11-16 10:12:05 +0000
commit18574d1ba9dae51bc49942201b3f6401b5051e2a (patch)
tree8cdddf31996ac7e8bf5f0c25e67ce3439c3c7dd0 /gio/gnotification.c
parentaf6bf2dc027f2308ceafbdd275f5c80c4265b633 (diff)
gnotification: Improve docs around GVariant ownership
Add a few missing introspection annotations too. This doesn’t change any of the ownership handling behaviour, just documents what’s there. What’s there seems to be correct, to the extent that I can see. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Diffstat (limited to 'gio/gnotification.c')
-rw-r--r--gio/gnotification.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gio/gnotification.c b/gio/gnotification.c
index 19bfca372..6848895b2 100644
--- a/gio/gnotification.c
+++ b/gio/gnotification.c
@@ -102,7 +102,7 @@ struct _GNotification
gchar *category;
GPtrArray *buttons;
gchar *default_action;
- GVariant *default_action_target;
+ GVariant *default_action_target; /* (nullable) (owned), not floating */
};
typedef struct
@@ -615,11 +615,17 @@ g_notification_get_button_with_action (GNotification *notification,
/*< private >
* g_notification_get_default_action:
* @notification: a #GNotification
- * @action: (nullable): return location for the default action
- * @target: (nullable): return location for the target of the default action
+ * @action: (out) (optional) (nullable) (transfer full): return location for the
+ * default action, or %NULL if unset
+ * @target: (out) (optional) (nullable) (transfer full): return location for the
+ * target of the default action, or %NULL if unset
*
* Gets the action and target for the default action of @notification.
*
+ * If this function returns %TRUE, @action is guaranteed to be set to a non-%NULL
+ * value (if a pointer is passed to @action). @target may still return a %NULL
+ * value, as the default action may have no target.
+ *
* Returns: %TRUE if @notification has a default action
*/
gboolean
@@ -736,7 +742,7 @@ g_notification_set_default_action_and_target (GNotification *notification,
* application-wide action (start with "app.").
*
* If @target is non-%NULL, @action will be activated with @target as
- * its parameter.
+ * its parameter. If @target is floating, it will be consumed.
*
* When no default action is set, the application that the notification
* was sent on is activated.