summaryrefslogtreecommitdiff
path: root/lisp/net/dbus.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2012-05-13 11:05:04 +0200
committerMichael Albinus <michael.albinus@gmx.de>2012-05-13 11:05:04 +0200
commit205a7391f7d6b5ffb4d366a142f69cfa0b8b3ac3 (patch)
treea3cbd1d4fc32e9a52fa026348e62b817b52d336d /lisp/net/dbus.el
parente5bd0a28953dcf6c3b811a7d17e7664c8d664a7c (diff)
downloademacs-205a7391f7d6b5ffb4d366a142f69cfa0b8b3ac3.tar.gz
* net/dbus.el (dbus-call-method): Restore events not from D-Bus. (Bug#11447)
Diffstat (limited to 'lisp/net/dbus.el')
-rw-r--r--lisp/net/dbus.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index d845a4932e2..c83651b41b5 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -263,12 +263,16 @@ object is returned instead of a list containing this single Lisp object.
(apply
'dbus-message-internal dbus-message-type-method-call
bus service path interface method 'dbus-call-method-handler args)))
+
;; Wait until `dbus-call-method-handler' has put the result into
;; `dbus-return-values-table'. If no timeout is given, use the
- ;; default 25".
+ ;; default 25". Events which are not from D-Bus must be restored.
(with-timeout ((if timeout (/ timeout 1000.0) 25))
(while (eq (gethash key dbus-return-values-table :ignore) :ignore)
- (read-event nil nil 0.1)))
+ (let ((event (let (unread-command-events) (read-event))))
+ (when (and event (not (ignore-errors (dbus-check-event event))))
+ (setq unread-command-events
+ (append unread-command-events (list event)))))))
;; Cleanup `dbus-return-values-table'. Return the result.
(prog1
@@ -1089,9 +1093,7 @@ denoting the bus address. SERVICE must be a known service name,
and PATH must be a valid object path. The last two parameters
are strings. The result, the introspection data, is a string in
XML format."
- ;; We don't want to raise errors. `dbus-call-method-non-blocking'
- ;; is used, because the handler can be registered in our Emacs
- ;; instance; caller and callee would block each other.
+ ;; We don't want to raise errors.
(dbus-ignore-errors
(dbus-call-method
bus service path dbus-interface-introspectable "Introspect"
@@ -1534,7 +1536,7 @@ The result is a list of objects. Every object is a cons of an
existing path name, and the list of available interface objects.
An interface object is another cons, which car is the interface
name, and the cdr is the list of properties as returned by
-`dbus-get-all-properties' for that path and interface. Example:
+`dbus-get-all-properties' for that path and interface. Example:
\(dbus-get-all-managed-objects :session \"org.gnome.SettingsDaemon\" \"/\")