Do away with `exwm-input--input-mode'

* exwm-input.el (exwm-input--update-mode-line): Remove.
(exwm-input--on-ButtonPress, exwm-input--on-KeyPress)
(exwm-input--update-mode-line, exwm-input-toggle-keyboard): Use
`exwm--input-mode' variable directly.
This commit is contained in:
Adrián Medraño Calvo 2018-10-21 12:00:00 +00:00
parent 01b0b54c04
commit dba1ed94c2
2 changed files with 5 additions and 13 deletions

View file

@ -411,7 +411,7 @@ ARGS are additional arguments to CALLBACK."
(when window (select-window window))))
(with-current-buffer buffer
(when (derived-mode-p 'exwm-mode)
(cl-case (exwm-input--current-input-mode)
(cl-case exwm--input-mode
(line-mode
(setq mode (exwm-input--on-ButtonPress-line-mode buffer button-event)))
(char-mode
@ -427,7 +427,7 @@ ARGS are additional arguments to CALLBACK."
(exwm--log "major-mode=%s buffer=%s"
major-mode (buffer-name (current-buffer)))
(if (derived-mode-p 'exwm-mode)
(cl-case (exwm-input--current-input-mode)
(cl-case exwm--input-mode
(line-mode
(exwm-input--on-KeyPress-line-mode obj data))
(char-mode
@ -688,17 +688,10 @@ The return value is used as event_mode to release the original
button event."
xcb:Allow:ReplayPointer)
(defun exwm-input--current-input-mode ()
"Return current input mode.
The return value is one of the symbols \\='line-mode or \\=`char-mode.
Current buffer must be an `exwm-mode' buffer."
exwm--input-mode)
(defun exwm-input--update-mode-line (id)
"Update the propertized `mode-line-process' for window ID."
(let (help-echo cmd mode)
(cl-case (exwm-input--current-input-mode)
(cl-case exwm--input-mode
(line-mode
(setq mode "line"
help-echo "mouse-1: Switch to char-mode"
@ -784,7 +777,7 @@ Current buffer must be an `exwm-mode' buffer."
(when id
(exwm--log "id=#x%x" id)
(with-current-buffer (exwm--id->buffer id)
(cl-case (exwm-input--current-input-mode)
(cl-case exwm--input-mode
(line-mode
(exwm-input-release-keyboard id))
(char-mode

View file

@ -45,7 +45,6 @@
(defvar exwm-layout--timer nil "Timer used to track echo area changes.")
(defvar exwm-workspace--current)
(declare-function exwm-input--current-input-mode "exwm-input.el")
(declare-function exwm-input--release-keyboard "exwm-input.el")
(declare-function exwm-input--grab-keyboard "exwm-input.el")
(declare-function exwm-input-grab-keyboard "exwm-input.el")
@ -200,7 +199,7 @@
(make-instance 'xcb:ewmh:set-_NET_WM_STATE :window exwm--id :data []))
(xcb:flush exwm--connection)
(set-window-dedicated-p (get-buffer-window) nil)
(when (eq 'line-mode (exwm-input--current-input-mode))
(when (eq 'line-mode exwm--input-mode)
(exwm-input--grab-keyboard exwm--id))))
;;;###autoload