mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 06:48:00 +01:00
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'.
This commit is contained in:
parent
44d05d2dd3
commit
fa204e1367
3 changed files with 24 additions and 14 deletions
|
@ -353,16 +353,19 @@ selected by `other-buffer'."
|
||||||
|
|
||||||
(defun exwm-layout--on-minibuffer-setup ()
|
(defun exwm-layout--on-minibuffer-setup ()
|
||||||
"Refresh layout when minibuffer grows."
|
"Refresh layout when minibuffer grows."
|
||||||
|
(when (frame-parameter nil 'exwm-outer-id)
|
||||||
(run-with-idle-timer 0.01 nil ;FIXME
|
(run-with-idle-timer 0.01 nil ;FIXME
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(when (< 1 (window-height (minibuffer-window)))
|
(when (< 1 (window-height (minibuffer-window)))
|
||||||
(exwm-layout--refresh))))
|
(exwm-layout--refresh))))
|
||||||
;; Set input focus on the Emacs frame
|
;; Set input focus on the Emacs frame
|
||||||
(x-focus-frame (window-frame (minibuffer-selected-window))))
|
(x-focus-frame (window-frame (minibuffer-selected-window)))))
|
||||||
|
|
||||||
(defun exwm-layout--on-echo-area-change (&optional dirty)
|
(defun exwm-layout--on-echo-area-change (&optional dirty)
|
||||||
"Run when message arrives or in `echo-area-clear-hook' to refresh layout."
|
"Run when message arrives or in `echo-area-clear-hook' to refresh layout."
|
||||||
(when (and (current-message)
|
(when (and (current-message)
|
||||||
|
;; Exclude non-graphical frames.
|
||||||
|
(frame-parameter nil 'exwm-outer-id)
|
||||||
(or (cl-position ?\n (current-message))
|
(or (cl-position ?\n (current-message))
|
||||||
(> (length (current-message))
|
(> (length (current-message))
|
||||||
(frame-width exwm-workspace--current))))
|
(frame-width exwm-workspace--current))))
|
||||||
|
|
|
@ -531,7 +531,9 @@ The optional FORCE option is for internal use only."
|
||||||
|
|
||||||
(defun exwm-workspace--on-minibuffer-setup ()
|
(defun exwm-workspace--on-minibuffer-setup ()
|
||||||
"Run in minibuffer-setup-hook to show the minibuffer and its container."
|
"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)
|
(add-hook 'post-command-hook #'exwm-workspace--update-minibuffer)
|
||||||
(exwm-workspace--show-minibuffer)
|
(exwm-workspace--show-minibuffer)
|
||||||
;; Set input focus on the Emacs frame
|
;; 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 ()
|
(defun exwm-workspace--on-minibuffer-exit ()
|
||||||
"Run in minibuffer-exit-hook to hide the minibuffer container."
|
"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)
|
(remove-hook 'post-command-hook #'exwm-workspace--update-minibuffer)
|
||||||
(exwm-workspace--hide-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 ()
|
(defun exwm-workspace--on-echo-area-dirty ()
|
||||||
"Run when new message arrives to show the echo area and its container."
|
"Run when new message arrives to show the echo area and its container."
|
||||||
(when (and (not (active-minibuffer-window))
|
(when (and (not (active-minibuffer-window))
|
||||||
|
;; Exclude non-graphical frames.
|
||||||
|
(frame-parameter nil 'exwm-outer-id)
|
||||||
(or (current-message)
|
(or (current-message)
|
||||||
cursor-in-echo-area))
|
cursor-in-echo-area))
|
||||||
(exwm-workspace--update-minibuffer t)
|
(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 ()
|
(defun exwm-workspace--on-echo-area-clear ()
|
||||||
"Run in echo-area-clear-hook to hide echo area container."
|
"Run in echo-area-clear-hook to hide echo area container."
|
||||||
|
(when (frame-parameter nil 'exwm-outer-id) ;Exclude non-graphical frames.
|
||||||
(unless (active-minibuffer-window)
|
(unless (active-minibuffer-window)
|
||||||
(exwm-workspace--hide-minibuffer))
|
(exwm-workspace--hide-minibuffer))
|
||||||
(when exwm-workspace--display-echo-area-timer
|
(when exwm-workspace--display-echo-area-timer
|
||||||
(cancel-timer exwm-workspace--display-echo-area-timer)
|
(cancel-timer exwm-workspace--display-echo-area-timer)
|
||||||
(setq exwm-workspace--display-echo-area-timer nil)))
|
(setq exwm-workspace--display-echo-area-timer nil))))
|
||||||
|
|
||||||
(declare-function exwm-manage--unmanage-window "exwm-manage.el")
|
(declare-function exwm-manage--unmanage-window "exwm-manage.el")
|
||||||
|
|
||||||
|
|
2
exwm.el
2
exwm.el
|
@ -557,7 +557,7 @@
|
||||||
(start-process exwm--server-name
|
(start-process exwm--server-name
|
||||||
nil
|
nil
|
||||||
(car command-line-args) ;The executable file
|
(car command-line-args) ;The executable file
|
||||||
"-d" x-display-name
|
"-d" (frame-parameter nil 'display)
|
||||||
"-Q"
|
"-Q"
|
||||||
(concat "--daemon=" exwm--server-name)
|
(concat "--daemon=" exwm--server-name)
|
||||||
"--eval"
|
"--eval"
|
||||||
|
|
Loading…
Reference in a new issue