After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 655818 - notification-daemon: Add support for 'default' actions
notification-daemon: Add support for 'default' actions
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-08-02 14:17 UTC by Florian Müllner
Modified: 2011-08-03 18:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
notification-daemon: Add support for 'default' actions (2.99 KB, patch)
2011-08-02 14:17 UTC, Florian Müllner
reviewed Details | Review
notification-daemon: Add support for 'default' actions (1.79 KB, patch)
2011-08-03 16:21 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2011-08-02 14:17:32 UTC
See attached patch.

It doesn't appear that there are many applications using default actions at the moment (Evolution being the only prominent example), but in my opinion it's a useful mechanism to allow processes without windows (g-s-d comes to mind) to do something meaningful when their notifications are clicked (e.g. opening the related g-c-c panel, ...)
Comment 1 Florian Müllner 2011-08-02 14:17:39 UTC
Created attachment 193077 [details] [review]
notification-daemon: Add support for 'default' actions

The notification spec supports the concept of a 'default' action:
  "The default action (usually invoked my clicking the notification)
   should have a key named "default". The name can be anything, though
   implementations are free not to display it."
Support this by invoking the 'default' action rather than a emitting
the 'clicked' signal when clicking notifications which specifie a
default action.
Also don't add an action button for the default action.
Comment 2 Dan Winship 2011-08-03 15:33:25 UTC
Comment on attachment 193077 [details] [review]
notification-daemon: Add support for 'default' actions

this should work, but I feel like it might be cleaner to do it all within notificationDaemon.js? Just connect to notification's 'clicked' signal there and call _emitActionInvoked?
Comment 3 Milan Bouchet-Valat 2011-08-03 16:07:59 UTC
Not immediately related, but shouldn't notifications have a close button so that you can dismiss them? If clicking on the notification's body invokes default action, how are we supposed to get rid of them?
Comment 4 Florian Müllner 2011-08-03 16:21:53 UTC
Created attachment 193193 [details] [review]
notification-daemon: Add support for 'default' actions

(In reply to comment #2)
> (From update of attachment 193077 [details] [review])
> this should work, but I feel like it might be cleaner to do it all within
> notificationDaemon.js?

Sure.
Comment 5 Florian Müllner 2011-08-03 18:12:55 UTC
Attachment 193193 [details] pushed as ddd59f2 - notification-daemon: Add support for 'default' actions

(In reply to comment #3)
> Not immediately related, but shouldn't notifications have a close button so
> that you can dismiss them? If clicking on the notification's body invokes
> default action, how are we supposed to get rid of them?

Clicking the notification body has never been a way to dismiss the notification, it will activate the application which emitted the notification (i.e. focus the most recently used window of that application). Some notifications don't have an associated application, so clicking the body apparently dismisses the notification - this inconsistency is pretty bad though.

A close button on notifications has been discussed before, but wasn't really deemed necessary by the designers. Notifications can be removed from the summary using he right-click menu, maybe that is enough.