It would be very nice to have a feature, where you could click the notification, and after click, it would open/focus the program where the notification came from.
Agreed, though I do like being able to dismiss notifications just by clicking on them. Perhaps this could be implemented as a "Show Application" button that is automatically added to notifications from any application that has a window; I believe this is how the Cinnamon DE does it.
Agreed, though I do like being able to dismiss notifications just by
clicking on them. Perhaps this could be implemented as a "Show Application"
button that is automatically added to notifications from any application
that has a window; I believe this is how the Cinnamon DE does it.
Agreed. Or maybe a Windows type of notification (https://i.imgur.com/1f7em1L.jpg) where you have a X icon where you could click on, and it would close the notification (and clicking anywhere else would open the program).
Generally speaking applications can already do this by adding an action. Just to be clear though, xfce4-notifyd does currently not support the "default action" feature, which seems to be what you are talking about and which would be invoked by clicking the notification bubble.
For the moment I don't plan to change this behaviour - most users seem happy with being able to close notifications easily.
I like to just add an +1 extra on this feature request.
Having an clickable dialog from an e.g. web push notification of firefox back to firefox loading an website would be very neat!
To add to this: certain applications, such as Firefox, currently display a button to "activate" their functionality when showing their notification, but said activation button is no longer accessible when the notification is stored in the panel log. At least in GNOME Shell it's still possible to activate the function when clicking on the log, as the button is still displayed - maybe we can check how do they do it in order to replicate it here?
xfce4-notifyd does currently not support the "default action" feature, which seems to be what you are talking about and which would be invoked by clicking the notification bubble.
For the moment I don't plan to change this behaviour - most users seem happy with being able to close notifications easily.
I'll join the choir of people asking to support the "default action".
Who's this "most users"? I've been using XFCE for years and it never occurred to me that clicking on a notification would actually make it close. In fact, I've always been searching for an X button that would do that job. If you want to be able to close it, then add a button to close it.
The way every single other platform where I received notifications work,
you click on the notification and something happens
The way every single other platform where I received notifications work,
you click on the notification and something happens
there is a very obvious way to dismiss it
Looks like XFCE does neither of these two.
To be fair, xfce4-notifyd probably predates most of those platforms, or at least is a contemporary. Regardless, I don't find "everyone else does X" to be a persuasive argument.
I personally like and rely heavily on the current behavior, and do not intend to change it. The most common action I take when I see a notification is to dismiss it; having to find and hit a much smaller close-button target is not something I want to have to do.
The point is moot, however, as there's no (reliable) way for the notification daemon to know what window to activate. It's possible, in some cases, to determine the right window to raise, but only if the app provides the desktop-entry hint when creating the notification, and... welp, no, nevermind. I thought there was a standardized window property where an app can put its desktop ID, but... it appears there isn't? So I'm not sure how GNOME does it. And even if there was such a property, if an app has multiple windows, we still wouldn't know which one to raise.
(When Firefox, for example, provides an 'Activate' button, the notification daemon just tells Firefox that the user clicked it; Firefox itself handles asking the WM to activate its window.)
If someone wants to look into how GNOME figures out which window to activate, feel free to reopen this and we can add a default 'Activate' button when the app doesn't provide any actions.
I personally like and rely heavily on the current behavior, and do not intend to change it. The most common action I take when I see a notification is to dismiss it; having to find and hit a much smaller close-button target is not something I want to have to do.
This looks to me as a very good argument to put a switch in the settings, rather than not implementing the feature altogether.
The point is moot, however, as there's no (reliable) way for the notification daemon to know what window to activate.
I see that the title of this issue does seem like it's asking for figuring out the window to activate, but in modern GTK that is not needed. Applications can set a default action (link to GTK docs), which is supposed to be executed when the notification is clicked on. I agree that if such a default action is not provided, xfce4-notifyd cannot understand what to do. But if it is provided, the user should at least have the option of being able to execute it.
(And then, since it is called "default action", I would personally put this behaviour as default; but if you really think that the default action, when clicking a notification, should be to close the notification, rather than executing the action provided by the notification itself, I wouldn't understand it, but I would be okay with it, as long as there is a switch in the options to change this behaviour.)
This looks to me as a very good argument to put a switch in the settings, rather than not implementing the feature altogether.
I'm not interested in adding this as a setting. Each configuration option adds a maintenance and testing burden, and I don't think it's worth it.
Regarding the default action, sure, I think it would be fine to add a button for it (if it's provided), but to me, it seems confusing that sometimes clicking the notification would activate a window, but other times it would do nothing. The average user has no understanding of "default actions" or of how the notification system works, or that some apps might provide a default action and some might provide nothing. All they would see and think is "sometimes when I click the notification it activates the application, and sometimes it doesn't... that must be a bug in the notification service!"
I've created #84 (closed) to track adding a button for the default action.
to me, it seems confusing that sometimes clicking the notification would activate a window, but other times it would do nothing. (...) "sometimes when I click the notification it activates the application, and sometimes it doesn't... that must be a bug in the notification service!"
If the action (or lack thereof) is application-dependent, personally I would find it easy to (rightfully) blame it on the application, rather than the notification service.
Anyway, I am very happy that there is interest on supporting default actions, which is a missing key feature in xfce4.
I still find it weird to have a button for the default action, if the GTK docs that I linked explicitly say (emphasis mine)
This action is activated when the notification is clicked on."
but I'm not the one developing, and I am very grateful to anybody that does, so I cannot complain too much. Also I think I will post any further comment to #84 (closed).
The GTK docs don't govern here; the notification specification says:
The default action (usually invoked my [sic] clicking the notification)
"Usually" does not require behavior, it only suggests it. Personally I think clicking a window and having some action being taken is not intuitive. I don't think comparisons to the notifications drawer on a mobile platform is particularly apt.