+2009-08-19 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/dbus.el (top): Apply `dbus-init-bus' only if the session bus
+ is running already.
+
2009-08-19 Stefan Monnier <monnier@iro.umontreal.ca>
* subr.el (listify-key-sequence-1): Use normal syntax since those
(defvar dbus-debug)
(defvar dbus-registered-functions-table)
-;; Initialize :system and :session buses. This adds their file
-;; descriptors to input_wait_mask, in order to detect incoming
-;; messages immediately.
-;; We must avoid to call the function twice for a bus, because the
-;; DBusWatch will be removed then.
-(when (and (featurep 'dbusbind) (not (featurep 'dbus)))
- (dbus-init-bus :system)
- (dbus-init-bus :session))
-
;; Pacify byte compiler.
(eval-when-compile
(require 'cl))
(cons property (dbus-get-property bus service path interface property))
'append)))))
+;; Initialize :system and :session buses. This adds their file
+;; descriptors to input_wait_mask, in order to detect incoming
+;; messages immediately.
+(dbus-ignore-errors
+ (when (getenv "DBUS_SESSION_BUS_ADDRESS")
+ (dbus-init-bus :system)
+ (dbus-init-bus :session)))
+
(provide 'dbus)
;; arch-tag: a47caf84-9162-4811-90cc-5d388e37b9bd