1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* net/dbus.el (top): Apply `dbus-init-bus' for the :session bus

only if it is running already.
This commit is contained in:
Michael Albinus 2009-08-19 07:15:28 +00:00
parent 03a74b84f8
commit 720c7cd6a9
2 changed files with 13 additions and 9 deletions

View file

@ -41,15 +41,6 @@
(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))
@ -841,6 +832,14 @@ name of the property, and its value. If there are no properties,
(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