about summary refs log tree commit diff
path: root/exwm.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2017-11-19T06·44+0800
committerChris Feng <chris.w.feng@gmail.com>2017-11-19T06·44+0800
commit0106dd69c767c8f7fdecb5f6f804ecaa0094848b (patch)
treebc9f3a0f27e172262d965ff0eac46af90756c1b7 /exwm.el
parent61274e09537c2d88f12a24b408464af00245bf11 (diff)
Correct the detection of emacsclient
* exwm.el (exwm-enable): Use `daemonp' instead of `display-graphic-p'.
Diffstat (limited to 'exwm.el')
-rw-r--r--exwm.el9
1 files changed, 4 insertions, 5 deletions
diff --git a/exwm.el b/exwm.el
index fe1024676b76..b64bdeececf1 100644
--- a/exwm.el
+++ b/exwm.el
@@ -726,11 +726,10 @@
      ;; Ignore unrecognized command line arguments.  This can be helpful
      ;; when EXWM is launched by some session manager.
      (push #'vector command-line-functions)
-     (if (display-graphic-p)
-         ;; emacs.
-         (add-hook 'window-setup-hook #'exwm-init t)
-       ;; emacsclient.
-       (add-hook 'after-make-frame-functions #'exwm-init t))
+     (add-hook (if (daemonp)
+                   'after-make-frame-functions ;emacsclient
+                 'window-setup-hook)           ;emacs
+               #'exwm-init t)
      (add-hook 'kill-emacs-hook #'exwm--server-stop)
      (dolist (i exwm-blocking-subrs)
        (advice-add i :around #'exwm--server-eval-at)))))