Commit Graph

78 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño) 1fba04bc03 notification: Include sender-pid hint by default if not provided
It's used by various daemons including GNOME Shell to figure out the
parent application.
2022-04-28 01:06:58 +02:00
Marco Trevisan (Treviño) d07785959c notification: Add support for getting actions activation token
Notification actions can now be activated with an activation token
containing platform data. So update the notification-spec to include
latest version of the specification, and expose the activation token
during an action activation.

Not to change the API, by modifying the type of NotifyActionCallback
it's just better to provide a function to fetch the activation token
during activation only, so that this can be retro-compatible.

Reference: https://gitlab.freedesktop.org/xdg/xdg-specs/-/commit/b9a4700
2022-04-27 18:02:20 +02:00
Marco Trevisan (Treviño) f9c1cf1b71 notification: Keep converted URIs as such when we prepend a path 2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) 997e2e374a notification: Do not duplicate calls on parse functions 2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) 0d86d8c8d5 notification: Improve debug logs when rewriting paths 2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) b2d6712b15 notification: Avoid creating a new hint variant when nothing has changed 2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) 961f45f44c notification: Use snap name and app name as fallback desktop-entry
Snaps use desktop IDs based on the snap name and the application name
inside the snap, so if we're in a such container, we need to compute the
desktop-entry using those values. We can figure them out from the snap
cgroup they're in.

In such case, don't even try to use the GApplication ID as that is
likely wrong in a snapped environment.
2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) e72396e8ca notification: Preserve snap details into the private struct
We may need to use them in various places, so there's no point to repeat
the same in multiple places, this way we can also use some shortcuts for
non-snap setups.
2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) d21b8140a8 notification: Do not try to append snap name to desktop when it's a path 2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) c4d5ea8baf notification: Do not prepend SNAP prefix when is already present
We used to just add it again, to eventually figure out that the file
did not exists, but may not work properly in some scenarios.

Also always fill the path_filename when using a file-name only, as that
may be refer to something under the SNAP path, and in such case we want
to try check if that exists before giving up.
2022-04-25 19:13:22 +02:00
Marco Trevisan (Treviño) d5a888fa31 notification: Use g_memdup2 when available
It's not really an issue here, as we use a properly typed len, but
better not to use a deprecated and potentially dangerous API.
2022-04-21 23:53:44 +02:00
Corentin Noël 333f7c5d32 Send the application ID when possible 2022-04-21 16:35:38 +02:00
Iain Lane 2e8ed8add3 notification: Handle snap applications
When a non-relocatable application is packaged as a snap, its resources
will be visible under `${SNAP}`. We can discover these resources by
probing paths that are given to us and trying the same path under
`${SNAP}` if the probe fails.

Snap packages have desktop files namespaced by the snap name. This name
is available inside the snap environment as `${SNAP_NAME}`. Also probe
desktop files and try this form of mangled name if the referenced
desktop file is not found.
2019-08-14 15:43:43 +02:00
Evan Nemerson da49c8c599 NotifyNotification: fix set_hint_byte_array value annotation
https://bugzilla.gnome.org/show_bug.cgi?id=667904
2014-04-01 21:19:01 +02:00
Giovanni Campagna 2b4ab4d22f NotifyNotification: fix annotation for add_action()
Using GFreeFunc instead of GDestroyNotify was a mistake, but
(scope async) is even a bigger mistake (one that can crash apps,
if an action is invoked multiple times)

https://bugzilla.gnome.org/show_bug.cgi?id=702390
2013-09-02 21:42:37 -04:00
Matthias Clasen 9128042026 Clarify docs of notify_notification_set_timeout
In response to
https://bugzilla.gnome.org/show_bug.cgi?id=701645
2013-06-07 20:28:10 -04:00
Richard Hughes 1c40dfaff4 Add notify_notification_set_app_name() to set the application name for the notification
When a daemon like gnome-settings-daemon has multiple plugins, if a plugin uses
notify_set_app_name() then subsequent notifications get the wrong
'Application name' in the gnome-shell persistent message tray.

This new function is per-notification and is thus allows us to set a custom
application name without overwriting the application name stored by notify_init().

https://bugzilla.gnome.org/show_bug.cgi?id=648947
2011-05-02 23:36:52 -04:00
Matthias Clasen 10ea1f0e65 Allow properties to be set in any order
The code as written needlessly required summary to be set first.
https://bugzilla.gnome.org/show_bug.cgi?id=645222
2011-03-20 23:51:55 -04:00
William Jon McCann b20752a2e5 Use - instead of _ in hint names consistently 2011-01-17 16:57:31 -05:00
Martin Pitt d3de00c14e Some more missing GIR annocations
https://bugzilla.gnome.org/show_bug.cgi?id=635169
2010-11-18 14:05:48 +01:00
Jonathan Matthew 84958a7acb Fix some annotations 2010-11-18 00:11:29 -05:00
William Jon McCann 54b6285006 Don't set NULL hint strings 2010-11-15 14:44:40 -05:00
William Jon McCann ef744d75d0 Show a warning and assert if notify_init isn't called before show 2010-11-15 12:44:32 -05:00
Javier Jardón 2ae1dadfa9 docs: Some fixes
https://bugzilla.gnome.org/show_bug.cgi?id=634266
2010-11-14 11:00:57 -05:00
Javier Jardón abb884af73 docs: Move documentation to inline comments: notification
https://bugzilla.gnome.org/show_bug.cgi?id=634266
2010-11-14 10:52:38 -05:00
Guillaume Desmottes 49766bca28 notify_notification_set_image_from_pixbuf: ref the pixbuf (#633829) 2010-11-02 17:02:37 +01:00
William Jon McCann d82ad1b225 Remove silly old dbus version comments in the docs 2010-10-15 00:14:24 -04:00
Christian Persch f63e8ab8b1 Port to gdbus
Bug #622891.
2010-10-12 15:57:33 +02:00
William Jon McCann b6c1835fcf Don't need to fuss with gtk symbols since we don't use gtk at all anymore 2010-10-09 00:32:31 -04:00
William Jon McCann 27e05d0f95 Remove the ability to attach notifications to widgets or positions 2010-10-08 22:47:06 -04:00
William Jon McCann 3f14ad4c71 Remove the ability to attach to a status icon
This technique is replaced by the use of notification persistence.
2010-10-08 22:31:40 -04:00
William Jon McCann 5be65318a4 Disconnect the proxy destroy signal handler 2010-06-24 04:29:55 -04:00
William Jon McCann 6471bfe9f4 Remove dbus version checks for > 0.60
We already require 0.78 in configure anyway
2010-06-24 02:21:44 -04:00
William Jon McCann dedef26ef9 Various cleanups 2010-06-24 02:12:40 -04:00
William Jon McCann d6476d362b Don't try to use the proxy after it is destroyed
https://bugzilla.gnome.org/show_bug.cgi?id=608089
2010-06-24 02:11:53 -04:00
Bastien Nocera 1f85092c96 Use g_object_get() to get pixbuf properties
Instead of 7 separate gdk_pixbuf function calls.

https://bugzilla.gnome.org/show_bug.cgi?id=622550
2010-06-24 01:50:34 +01:00
Bastien Nocera 9a822e1af9 Fix compile-time warning 2010-06-24 00:12:06 +01:00
William Jon McCann 5b3f2617d2 Fix building with GSEAL enabled
https://bugzilla.gnome.org/show_bug.cgi?id=612720
2010-04-02 20:10:29 -04:00
William Jon McCann 597ba8d292 Removed unused code 2010-04-02 19:54:40 -04:00
Aurélien Gâteau 117a582b9b Introduce notify_notification_set_image_from_pixbuf
Same as notify_notification_set_icon_from_pixbuf, but with a more explicit name.
notify_notification_set_icon_from_pixbuf is marked as deprecated.
2010-01-29 05:58:38 -05:00
Aurélien Gâteau 6c1231835d Support for image_data hint
Add support for the image_data hint from version 1.1 of the spec.
2010-01-29 05:50:49 -05:00
William Jon McCann 4db61ddb45 Use a consistent style 2010-01-29 04:35:35 -05:00
Matthias Clasen 4b11bb71cf Fix has_nondefault_actions never getting set
Due to an oversight in the condition, has_nondefault_actions is
never set to true.  Not sure this makes a _big_ difference in practice.

http://trac.galago-project.org/ticket/194
2010-01-09 13:13:15 -05:00
William Jon McCann 732437ffc0 Depend on Gtk+ 2.10 for StatusIcon 2010-01-09 13:04:32 -05:00
William Jon McCann 8374438dcf Fix indentation 2010-01-09 13:00:58 -05:00
William Jon McCann 9607cf459f Use only single gtk include 2010-01-09 13:00:53 -05:00
Christian Hammond 40781ff602 Patch by Andre Klapper to remove deprecated glib symbols. 2009-07-24 09:13:56 +00:00
Christian Hammond d29c11ba8d And fix the registration of the signal. It's been way too long since I worked with gtk in C. Or not long enough. 2008-09-26 01:51:01 +00:00
Christian Hammond cf2f667318 Prevent a backwards-compatibility breakage introduced where the "reason" code was added to the "closed" signal. This meant that existing signal handlers that passed extra data would break. We now require that you call notify_notification_get_closed_reason() to get this data. 2008-09-26 01:46:40 +00:00
Christian Hammond d5addcc1f4 Added support for sending the status icon XID to the notification daemon. This will allow better position tracking for context notifications. Patch by Colin Walters. 2008-09-26 01:12:47 +00:00