Skip to content

Commit

Permalink
notification: Add supported-options property
Browse files Browse the repository at this point in the history
Let applications query supported options for category and button purpose.
  • Loading branch information
jsparber committed Aug 30, 2024
1 parent 54af40d commit cd5a401
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
11 changes: 11 additions & 0 deletions data/org.freedesktop.impl.portal.Notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@
<arg type="s" name="id" direction="in"/>
</method>

<!--
SupportedOptions:
Some properties in :ref:`org.freedesktop.impl.portal.Notification.AddNotification`
may have options advertised by the notification server.
The format is the same as for ``SupportedOptions`` property of
:ref:`org.freedesktop.portal.Notification`.
-->
<property name="SupportedOptions" type="a{sv}" access="read"/>

<!--
ActionInvoked:
@app_id: App id of the application
Expand Down
19 changes: 19 additions & 0 deletions data/org.freedesktop.portal.Notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,25 @@
<arg type="s" name="id" direction="in"/>
</method>

<!--
SupportedOptions:
Some properties in :ref:`org.freedesktop.portal.Notification.AddNotification`
may have options advertised by the server.
Currently there are the following options the notification server can advertise:
* ``category`` (``as``)
Categories that the notification server understands and supports.
* ``button-purpose`` (``as``)
Button purposes that the notification server understands and supports.
This is the list of options that can be used as `purpose` for `buttons`.
-->
<property name="SupportedOptions" type="a{sv}" access="read"/>

<!--
ActionInvoked:
@id: the application-provided ID for the notification
Expand Down
3 changes: 3 additions & 0 deletions src/notification.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,9 @@ static void
notification_init (Notification *notification)
{
xdp_dbus_notification_set_version (XDP_DBUS_NOTIFICATION (notification), 2);
g_object_bind_property (G_OBJECT (impl), "supported-options",
G_OBJECT (notification), "supported-options",
G_BINDING_SYNC_CREATE);
}

static void
Expand Down

0 comments on commit cd5a401

Please sign in to comment.