From dff1ef6a3c36fd7d8b3a3bafbd66a91b8e576b26 Mon Sep 17 00:00:00 2001 From: Adrián Medraño Calvo Date: Mon, 8 Oct 2018 12:00:00 +0000 Subject: Simplify input handling No functional change. * exwm-input.el (exwm-input--current-input-mode): New function indicating keyboard input mode. (exwm-input--on-KeyPress, exwm-input--update-mode-line): Use `exwm-input--current-input-mode'. (exwm-input-grab-keyboard, exwm-input-release-keyboard) (exwm-input--update-mode-line): Simplify. * exwh-core.el (exwm--on-KeyPress): Remove variable, use `exwm--keyboard-grabbed' and `exwm-input--current-input-mode' instead. --- exwm-layout.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'exwm-layout.el') diff --git a/exwm-layout.el b/exwm-layout.el index 56faadd99209..90988faae07f 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -45,6 +45,7 @@ (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") @@ -199,7 +200,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 exwm--keyboard-grabbed + (when (eq 'line-mode (exwm-input--current-input-mode)) (exwm-input--grab-keyboard exwm--id)))) ;;;###autoload -- cgit 1.4.1