[Galago-devel] libnotify: system freezes for a few secs. on notify_notification_show

Sundaram legends2k at yahoo.com
Thu Feb 5 01:16:19 PST 2009


Hi,
Is libnotify thread safe? Should I call dbus_g_thread_init() to make sure it is?

I have written a Eng. thesaurus Artha using GLib & GTK+, in which, when I get a particular hot key combination, on that key press signal handler, I call notify_notification_show() [before this, I close any earlier notifications by notify_notification_close()]. Everything works fine.

But, when I press that hot key combo more than a few times, say 10, for a first few I get notification after notification, but towards the end (arbitrary), the app. freezes and even the desktop freezes for a few seconds (8 to 10 secs) and then I see the notification and everything gets back to normal, including my app. But when this happens, notify_notification_show() returns a FALSE (eventhough a notification was shown), and GError msg reads thus: "Did
not receive a reply. Possible causes include: the remote application
did not send a reply, the message bus security policy blocked the
reply, the reply timeout expired, or the network connection was broken.".

As for the code, before calling any other func. I call g_thread_init(), then dbus_g_thread_init and notify_init() and then get a notifier handle by calling notify_notification_new_with_status_icon() with a GtkStatus icon, in my main, all of them only once. After that, when in gtk_main() loop, when ever I get a hot key press signal every time, I update the body & summary of the same notifier with a new one using notify_notification_update() and then call notify_notification_show(). I haven't used any thread related functions except the above ones (init). Is anything wrong in this approach that libnotify's notify_notification_show() chokes the whole system for a few seconds, because of my wrong way of using it? Or is it a glitch on libnotify's side?

Thanks!

Regards,
Sundaram



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/galago-devel/attachments/20090205/cb218e1f/attachment.html 


More information about the galago-devel mailing list