Notifications Implementation

Notify() DBus method the notification daemon implements has the following parameters: appName, replacesId, icon, summary, body, actions, hints, timeout

Notification daemon gets the pid of the notification sender and gets an application based on it with this.app = Shell.WindowTracker.get_default().get_app_from_pid(this._pid);

Notification explained

Source Title - this.app.get_name() if have this.app; else appName Notify() parameter

Source Icon - this.app.create_icon_texture(this.ICON_SIZE) if have this.app; else same as Notification Icon

Notification Icon - icon Notify() parameter if specified; else 'image-data', 'image_data', 'image-path', 'image_path' or 'icon_data' hint if any one of them is specified; else default icon

Notification Image - 'image-data', 'image_data', 'image-path', 'image_path' or 'icon_data' hint if any one of them is specified, but only if icon Notify() parameter is also specified

Notification Summary - summary Notify() parameter

Notification Body - body Notify() parameter

Notification Actions - actions Notify() parameter; with images instead of labels looked up by action id in the icon theme if 'action-icons' hint is specified

'image-data' Hint is Commonly Used

Many applications, such as Abrt and Firefox use notify_notification_set_icon_from_pixbuf() .

In libnotify/libnotify/notification.c it is marked as deprecated and calls notify_notification_set_image_from_pixbuf() , which sets 'image-data' hint for notification daemons claiming to implement the 1.2 spec (like the one in gnome-shell).

Discussed Ideas

  1. Use this.app.create_icon_texture(this.ICON_SIZE) if have this.app for Notification Icon, as well as for Source Icon to ensure they are always the same

  2. Add app_id parameter to Notify() to allow looking up the desktop file

Design/OS/MessageTray/Implementation (last edited 2015-01-10 13:17:59 by OliverPropst)