[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dbus-call-method blocks for a long time
From: |
Michael Albinus |
Subject: |
Re: dbus-call-method blocks for a long time |
Date: |
Fri, 15 Feb 2013 11:48:04 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Lluís <address@hidden> writes:
Hi Lluís,
> I'm not quite sure if this is an issue with `notifications' but this piece of
> code is getting my emacs completely frozen for a while every time it calls
> `notifications-notify' (sometimes not even C-g gets out of it):
>
> #v+
> (defun gnus-notifications-notify (from subject photo-file)
> "Send a notification about a new mail.
> Return a notification id if any, or t on success."
> (if (fboundp 'notifications-notify)
> (gnus-funcall-no-warning
> 'notifications-notify
> :title from
> :body subject
> :actions '("read" "Read")
> :on-action 'gnus-notifications-action
> :app-icon (gnus-funcall-no-warning
> 'image-search-load-path "gnus/gnus.png")
> :app-name "Gnus"
> :category "email.arrived"
> :timeout gnus-notifications-timeout
> :image-path photo-file)
> (message "New message from %s: %s" from subject)
> ;; Don't return an id
> t))
> #v-
`notifications-notify' doesn't set a timeout for `dbus-call-method' and
`dbus-get-name-owner' (maybe they should). Therefore, the default
timeout of D-Bus is used, which is 25,000 milliseconds. And indeed, both
functions wait exactly this time:
> dbus-call-method 6 150.09408380 25.015680634
> dbus-get-name-owner 3 75.051887114 25.017295704
> Looks strange to me that `dbus-call-method' takes so long while the
> notification
> message appears immediately on my screen.
This is really strange. When the notification appears on your desktop,
`dbus-call-method' has been applied successfully. But Emacs does not
receive the return message of that call.
> Does this sound like a problem in Emacs's DBus immplementation, or should I
> rather look in another direction?
Do you have some special settings wrt D-Bus? For example, do you play
with $DBUS_SESSION_BUS_ADDRESS, or do you use a private D-Bus
connection?
Could you trace D-Bus events in a shell outside Emacs, by calling
"dbus-monitor"? In parallel, you might also trace D-Bus events inside
Emacs by setting `dbus-debug' to `t'.
> Thanks,
> Lluis
Best regards, Michael.