about summary refs log tree commit diff
path: root/exwm-workspace.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-03-25T05·57+0800
committerChris Feng <chris.w.feng@gmail.com>2016-03-25T05·57+0800
commitfa204e136718e106a87414dd145d16748d5b7262 (patch)
treee156dda1ea4607b1f97f6e4b3298776bb6cd6e8c /exwm-workspace.el
parent44d05d2dd3e8214ef8815f7433758e9e155db3c9 (diff)
Fix emacsclient issues
* exwm-layout.el (exwm-layout--on-minibuffer-setup)
(exwm-layout--on-echo-area-change):
* exwm-workspace.el (exwm-workspace--on-minibuffer-setup)
(exwm-workspace--on-minibuffer-exit, exwm-workspace--on-echo-area-dirty)
(exwm-workspace--on-echo-area-clear):
Exclude non-graphical frames.

* exwm.el (exwm--server-eval-at): Avoid using `x-dispaly-name'.
Diffstat (limited to 'exwm-workspace.el')
-rw-r--r--exwm-workspace.el21
1 files changed, 14 insertions, 7 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index d8e84f3f87b3..8dd6284d1dec 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -531,7 +531,9 @@ The optional FORCE option is for internal use only."
 
 (defun exwm-workspace--on-minibuffer-setup ()
   "Run in minibuffer-setup-hook to show the minibuffer and its container."
-  (unless (> -1 (minibuffer-depth))
+  (when (and (= 1 (minibuffer-depth))
+             ;; Exclude non-graphical frames.
+             (frame-parameter nil 'exwm-outer-id))
     (add-hook 'post-command-hook #'exwm-workspace--update-minibuffer)
     (exwm-workspace--show-minibuffer)
     ;; Set input focus on the Emacs frame
@@ -539,7 +541,9 @@ The optional FORCE option is for internal use only."
 
 (defun exwm-workspace--on-minibuffer-exit ()
   "Run in minibuffer-exit-hook to hide the minibuffer container."
-  (unless (> -1 (minibuffer-depth))
+  (when (and (= 1 (minibuffer-depth))
+             ;; Exclude non-graphical frames.
+             (frame-parameter nil 'exwm-outer-id))
     (remove-hook 'post-command-hook #'exwm-workspace--update-minibuffer)
     (exwm-workspace--hide-minibuffer)))
 
@@ -548,6 +552,8 @@ The optional FORCE option is for internal use only."
 (defun exwm-workspace--on-echo-area-dirty ()
   "Run when new message arrives to show the echo area and its container."
   (when (and (not (active-minibuffer-window))
+             ;; Exclude non-graphical frames.
+             (frame-parameter nil 'exwm-outer-id)
              (or (current-message)
                  cursor-in-echo-area))
     (exwm-workspace--update-minibuffer t)
@@ -561,11 +567,12 @@ The optional FORCE option is for internal use only."
 
 (defun exwm-workspace--on-echo-area-clear ()
   "Run in echo-area-clear-hook to hide echo area container."
-  (unless (active-minibuffer-window)
-    (exwm-workspace--hide-minibuffer))
-  (when exwm-workspace--display-echo-area-timer
-    (cancel-timer exwm-workspace--display-echo-area-timer)
-    (setq exwm-workspace--display-echo-area-timer nil)))
+  (when (frame-parameter nil 'exwm-outer-id) ;Exclude non-graphical frames.
+    (unless (active-minibuffer-window)
+      (exwm-workspace--hide-minibuffer))
+    (when exwm-workspace--display-echo-area-timer
+      (cancel-timer exwm-workspace--display-echo-area-timer)
+      (setq exwm-workspace--display-echo-area-timer nil))))
 
 (declare-function exwm-manage--unmanage-window "exwm-manage.el")