about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorAdrián Medraño Calvo <adrian@medranocalvo.com>2018-10-24T12·00+0000
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2018-10-24T12·00+0000
commitdbccda22a6b6e32a9e547954ec660ad8e80b7416 (patch)
tree04f11fab01f26a1fe7ad0351299b0254870c06f6 /exwm-input.el
parent01b0b54c04d043c47184019c75cc668da2427aa8 (diff)
parenteb91ee2c77787bbeb1df74f0237f5087d031217f (diff)
Merge branch 'medranocalvo/fix-input-mode-after-fullscreen' into externals/exwm
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el17
1 files changed, 6 insertions, 11 deletions
diff --git a/exwm-input.el b/exwm-input.el
index 6e8f6d814a70..c757b09d3fa6 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -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"
@@ -763,6 +756,7 @@ Current buffer must be an `exwm-mode' buffer."
                        (exwm--buffer->id (window-buffer)))))
   (when id
     (exwm--log "id=#x%x" id)
+    (setq exwm--selected-input-mode 'line-mode)
     (exwm-input--grab-keyboard id)
     (exwm-input--update-mode-line id)))
 
@@ -773,6 +767,7 @@ Current buffer must be an `exwm-mode' buffer."
                        (exwm--buffer->id (window-buffer)))))
   (when id
     (exwm--log "id=#x%x" id)
+    (setq exwm--selected-input-mode  'char-mode)
     (exwm-input--release-keyboard id)
     (exwm-input--update-mode-line id)))
 
@@ -784,7 +779,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