Review Request: Ensure notifications sent to DBus notification daemons are compatible with that daemon's capabilities
Sjors Gielen
dazjorz at dazjorz.com
Fri Jul 9 12:55:57 BST 2010
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/4555/
-----------------------------------------------------------
(Updated 2010-07-09 11:55:56.993625)
Review request for kdelibs, Olivier Goffart and Aurélien Gâteau.
Changes
-------
I added a bug that seemed related, but it in fact doesn't seem to be. This might confuse people, so I'm removing it from this review request.
Summary
-------
KNotify supports sending notifications to a DBus notification daemon, but it currently does not make sure the notifications it sends are compatible with that specific daemon. More concretely, notify-osd by design does not support HTML bodies or 'actions' (clickable buttons). It reports it does not support them, when you ask for its capabilities; however, knotify does not currently do that. KNotify then sends actions and HTML markup anyway, resulting in notify-osd displaying an ugly focus-stealing dialog, sometimes even with plaintext HTML entities in them.
This patch implements asking the notification daemon for capabilities. If a capability is not supported, its use is removed before sending the notification. There are no public API changes.
I would like to thank Aurélien Gateau for the capability retrieving parts of this patch (they were in another one of his patches, but those got rejected earlier because of the general goal of that patchset). If this patch is accepted, I would like it to be in the KDE 4.5 release, primarily because it makes KDE applications that use KNotify usable on Ubuntu again.
Diffs
-----
/trunk/KDE/kdebase/runtime/knotify/notifybypopup.h 1147918
/trunk/KDE/kdebase/runtime/knotify/notifybypopup.cpp 1147918
Diff: http://reviewboard.kde.org/r/4555/diff
Testing
-------
The patch compiles and works on my Mac. I have quickly written a notification daemon of my own, and changing the capabilities directly changes the way the notifications are sent. I haven't tested what happens when a notification server does not implement the GetCapabilities call, but if that happens the code should assume that the daemon does not support anything and it will strip everything off.
The code itself is only tested on Mac OS X, running my own notification daemon. I expect it to work on Gnome with notify-osd, and if Plasma implements GetCapabilities correctly, behavior should not change there. Testing on those platforms is still required.
Thanks,
Sjors
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100709/05f767a5/attachment.htm>
More information about the kde-core-devel
mailing list