KNotify use in Plasmoid code freezes KDE

Aaron J. Seigo aseigo at kde.org
Tue May 21 13:34:41 UTC 2013


On Sunday, May 12, 2013 20:07:52 Dominik George wrote:
> We already limited the botification number to one event per minute,
> however, the code still freezes KDE.

by "KDE" i assume you mean the plasma-desktop process (and that other 
application windows remain responsive; alt-tab'ing still works, etc)

> Attached is the plasmoid code that crashes, removing the comment sign at
> the beginning of line 317 introduces notifications and the freeze.

i'm not sure why, but you are using the org.kde.KNotify dbus interface 
directly via QtDBus .. and doing so with a blocking call.

you must never call knotify synchronously in plasma-desktop (though it is not 
a good idea to do so anywhere). make it an async dbus call and things should 
be fine.

better yet, use the KNotification API as it does things properly and means you 
aren't using a DBus API directly.

(what is happening is that it is making a dbus call synchronously which blocks 
the main application thread; knotify then attempts to signal the notification 
plasmoid which is running plasma-desktop and voila .. it can't.)

CC'ing plasma-devel because this represents a nice junior job:

	Move the dbus use in the notifications dataengine into a separate thread.

that should help prevent future issues like this. still: never call knotify 
synchronously.

-- 
Aaron J. Seigo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20130521/fb582f47/attachment.sig>


More information about the Plasma-devel mailing list