mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 14:57:59 +01:00
exwm-systemtray--init, exwm-xsettings--init: Idempotent initialization
* exwm-systemtray.el (exwm-systemtray--init), exwm-xsettings.el (exwm-xsettings--init): Return early if already initialized.
This commit is contained in:
parent
63bde86545
commit
d41de490e3
2 changed files with 6 additions and 2 deletions
|
@ -491,7 +491,9 @@ Argument DATA contains the raw event data."
|
||||||
(cl-defun exwm-systemtray--init ()
|
(cl-defun exwm-systemtray--init ()
|
||||||
"Initialize system tray module."
|
"Initialize system tray module."
|
||||||
(exwm--log)
|
(exwm--log)
|
||||||
(cl-assert (not exwm-systemtray--connection))
|
;; idempotent initialization
|
||||||
|
(when exwm-systemtray--connection
|
||||||
|
(cl-return-from exwm-systemtray--init))
|
||||||
(cl-assert (not exwm-systemtray--list))
|
(cl-assert (not exwm-systemtray--list))
|
||||||
(cl-assert (not exwm-systemtray--selection-owner-window))
|
(cl-assert (not exwm-systemtray--selection-owner-window))
|
||||||
(cl-assert (not exwm-systemtray--embedder-window))
|
(cl-assert (not exwm-systemtray--embedder-window))
|
||||||
|
|
|
@ -238,7 +238,9 @@ SERIAL is a sequence number."
|
||||||
"Initialize the XSETTINGS module."
|
"Initialize the XSETTINGS module."
|
||||||
(exwm--log)
|
(exwm--log)
|
||||||
|
|
||||||
(cl-assert (not exwm-xsettings--connection))
|
;; idempotent initialization
|
||||||
|
(when exwm-xsettings--connection
|
||||||
|
(cl-return-from exwm-xsettings--init))
|
||||||
|
|
||||||
;; Connect
|
;; Connect
|
||||||
(setq exwm-xsettings--connection (xcb:connect))
|
(setq exwm-xsettings--connection (xcb:connect))
|
||||||
|
|
Loading…
Reference in a new issue