mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 14:57:59 +01:00
Merge branch 'retain-echo-area-until-input' of https://github.com/medranocalvo/exwm into medranocalvo/retain-echo-area-until-input
This commit is contained in:
commit
225c68d4ce
2 changed files with 26 additions and 3 deletions
|
@ -140,6 +140,9 @@ defined in `exwm-mode-map' here."
|
||||||
(defvar exwm-input--update-focus-window nil "The (Emacs) window to be focused.
|
(defvar exwm-input--update-focus-window nil "The (Emacs) window to be focused.
|
||||||
This value should always be overwritten.")
|
This value should always be overwritten.")
|
||||||
|
|
||||||
|
(defvar exwm-input--event-hook nil
|
||||||
|
"Hook to run when EXWM receives an event.")
|
||||||
|
|
||||||
(defvar exwm-workspace--current)
|
(defvar exwm-workspace--current)
|
||||||
(declare-function exwm-floating--do-moveresize "exwm-floating.el"
|
(declare-function exwm-floating--do-moveresize "exwm-floating.el"
|
||||||
(data _synthetic))
|
(data _synthetic))
|
||||||
|
@ -430,7 +433,8 @@ ARGS are additional arguments to CALLBACK."
|
||||||
(setq mode xcb:Allow:ReplayPointer))))
|
(setq mode xcb:Allow:ReplayPointer))))
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:AllowEvents :mode mode :time xcb:Time:CurrentTime))
|
(make-instance 'xcb:AllowEvents :mode mode :time xcb:Time:CurrentTime))
|
||||||
(xcb:flush exwm--connection)))
|
(xcb:flush exwm--connection))
|
||||||
|
(run-hooks 'exwm-input--event-hook))
|
||||||
|
|
||||||
(defun exwm-input--on-KeyPress (data _synthetic)
|
(defun exwm-input--on-KeyPress (data _synthetic)
|
||||||
"Handle KeyPress event."
|
"Handle KeyPress event."
|
||||||
|
@ -444,7 +448,8 @@ ARGS are additional arguments to CALLBACK."
|
||||||
(exwm-input--on-KeyPress-line-mode obj data))
|
(exwm-input--on-KeyPress-line-mode obj data))
|
||||||
(char-mode
|
(char-mode
|
||||||
(exwm-input--on-KeyPress-char-mode obj data)))
|
(exwm-input--on-KeyPress-char-mode obj data)))
|
||||||
(exwm-input--on-KeyPress-char-mode obj))))
|
(exwm-input--on-KeyPress-char-mode obj)))
|
||||||
|
(run-hooks 'exwm-input--event-hook))
|
||||||
|
|
||||||
(defun exwm-input--on-CreateNotify (data _synthetic)
|
(defun exwm-input--on-CreateNotify (data _synthetic)
|
||||||
"Handle CreateNotify events."
|
"Handle CreateNotify events."
|
||||||
|
|
|
@ -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-workspace--workareas nil "Workareas (struts excluded).")
|
||||||
|
|
||||||
(defvar exwm-input--during-command)
|
(defvar exwm-input--during-command)
|
||||||
|
(defvar exwm-input--event-hook)
|
||||||
(defvar exwm-layout-show-all-buffers)
|
(defvar exwm-layout-show-all-buffers)
|
||||||
(defvar exwm-manage--desktop)
|
(defvar exwm-manage--desktop)
|
||||||
(declare-function exwm-input--on-buffer-list-update "exwm-input.el" ())
|
(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)
|
input-method-use-echo-area)
|
||||||
(setq exwm-workspace--display-echo-area-timer
|
(setq exwm-workspace--display-echo-area-timer
|
||||||
(run-with-timer exwm-workspace-display-echo-area-timeout nil
|
(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 ()
|
(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."
|
||||||
|
@ -1598,6 +1610,9 @@ applied to all subsequently created X frames."
|
||||||
(add-hook 'after-make-frame-functions
|
(add-hook 'after-make-frame-functions
|
||||||
#'exwm-workspace--on-after-make-frame)
|
#'exwm-workspace--on-after-make-frame)
|
||||||
(add-hook 'delete-frame-functions #'exwm-workspace--on-delete-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
|
;; Switch to the first workspace
|
||||||
(exwm-workspace-switch 0 t)
|
(exwm-workspace-switch 0 t)
|
||||||
;; Prevent frame parameters introduced by this module from being
|
;; 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)
|
#'exwm-workspace--on-after-make-frame)
|
||||||
(remove-hook 'delete-frame-functions
|
(remove-hook 'delete-frame-functions
|
||||||
#'exwm-workspace--on-delete-frame)
|
#'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
|
;; Hide & reparent out all frames (save-set can't be used here since
|
||||||
;; X windows will be re-mapped).
|
;; X windows will be re-mapped).
|
||||||
(setq exwm-workspace--current nil)
|
(setq exwm-workspace--current nil)
|
||||||
|
|
Loading…
Reference in a new issue