diff options
author | Chris Feng <chris.w.feng@gmail.com> | 2019-02-06T00·00+0000 |
---|---|---|
committer | Chris Feng <chris.w.feng@gmail.com> | 2019-02-06T00·00+0000 |
commit | 225c68d4ce5fd3c9726b27eb6fc3ab2b223d2ec3 (patch) | |
tree | 34488c76aad3483ea330b53f3660e435118763b7 /exwm-workspace.el | |
parent | e15728203834ac85a51997366d0a019acef56d6f (diff) | |
parent | cd7b32d1c203b87d428ea75e5a5e1452d8236742 (diff) |
Merge branch 'retain-echo-area-until-input' of https://github.com/medranocalvo/exwm into medranocalvo/retain-echo-area-until-input
Diffstat (limited to 'exwm-workspace.el')
-rw-r--r-- | exwm-workspace.el | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el index 5a84ec9f00ec..783287366aff 100644 --- a/exwm-workspace.el +++ b/exwm-workspace.el @@ -128,6 +128,7 @@ Please manually run the hook `exwm-workspace-list-change-hook' afterwards.") (defvar exwm-workspace--workareas nil "Workareas (struts excluded).") (defvar exwm-input--during-command) +(defvar exwm-input--event-hook) (defvar exwm-layout-show-all-buffers) (defvar exwm-manage--desktop) (declare-function exwm-input--on-buffer-list-update "exwm-input.el" ()) @@ -1221,7 +1222,18 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first." input-method-use-echo-area) (setq exwm-workspace--display-echo-area-timer (run-with-timer exwm-workspace-display-echo-area-timeout nil - #'exwm-workspace--on-echo-area-clear))))) + #'exwm-workspace--echo-area-maybe-clear))))) + +(defun exwm-workspace--echo-area-maybe-clear () + "Eventually clear the echo area container." + (exwm--log) + (if (not (current-message)) + (exwm-workspace--on-echo-area-clear) + ;; Reschedule. + (cancel-timer exwm-workspace--display-echo-area-timer) + (setq exwm-workspace--display-echo-area-timer + (run-with-timer exwm-workspace-display-echo-area-timeout nil + #'exwm-workspace--echo-area-maybe-clear)))) (defun exwm-workspace--on-echo-area-clear () "Run in echo-area-clear-hook to hide echo area container." @@ -1598,6 +1610,9 @@ applied to all subsequently created X frames." (add-hook 'after-make-frame-functions #'exwm-workspace--on-after-make-frame) (add-hook 'delete-frame-functions #'exwm-workspace--on-delete-frame) + (when (exwm-workspace--minibuffer-own-frame-p) + (add-hook 'exwm-input--event-hook + #'exwm-workspace--on-echo-area-clear)) ;; Switch to the first workspace (exwm-workspace-switch 0 t) ;; Prevent frame parameters introduced by this module from being @@ -1619,6 +1634,9 @@ applied to all subsequently created X frames." #'exwm-workspace--on-after-make-frame) (remove-hook 'delete-frame-functions #'exwm-workspace--on-delete-frame) + (when (exwm-workspace--minibuffer-own-frame-p) + (remove-hook 'exwm-input--event-hook + #'exwm-workspace--on-echo-area-clear)) ;; Hide & reparent out all frames (save-set can't be used here since ;; X windows will be re-mapped). (setq exwm-workspace--current nil) |