Various input fixes

* Fix `exwm-reset`
* Make input mode buffer local
* Allow window to stay in `char-mode` while setting input focus to other window
  or switching to other workspace
This commit is contained in:
Chris Feng 2015-08-07 12:41:15 +08:00
parent 1e36a22b3f
commit 2ad1a89db0
3 changed files with 29 additions and 27 deletions

View file

@ -98,20 +98,20 @@
The optional FORCE option is for internal use only."
(interactive
(list
(let* ((history-add-new-input nil) ;prevent modifying history
(idx (read-from-minibuffer
"Workspace: " (elt exwm-workspace--switch-history
exwm-workspace-current-index)
exwm-workspace--switch-map nil
`(exwm-workspace--switch-history
. ,(1+ exwm-workspace-current-index)))))
(cl-position idx exwm-workspace--switch-history :test 'equal))))
(unless exwm-workspace--switch-lock
(unless (and (eq major-mode 'exwm-mode) exwm--fullscreen) ;it's invisible
(let* ((history-add-new-input nil) ;prevent modifying history
(idx (read-from-minibuffer
"Workspace: " (elt exwm-workspace--switch-history
exwm-workspace-current-index)
exwm-workspace--switch-map nil
`(exwm-workspace--switch-history
. ,(1+ exwm-workspace-current-index)))))
(cl-position idx exwm-workspace--switch-history :test 'equal)))))
(unless (or exwm-workspace--switch-lock (not index))
(setq exwm-workspace--switch-lock t)
(unless (and (<= 0 index) (< index exwm-workspace-number))
(user-error "[EXWM] Workspace index out of range: %d" index))
(when (or force (/= exwm-workspace-current-index index))
(exwm-reset) ;exit full screen
(let ((frame (elt exwm-workspace--list index)))
(setq exwm-workspace--current frame
exwm-workspace-current-index index)