Fixed fail update when current buffer differs from window

Local variable `exwm--input-mode' from different buffer when current buffer don't contains #id window.

`with-current-buffer' changes buffer after `cl-case' with local `exwm--input-mode'
This commit is contained in:
Curiosidad-Racional 2020-03-21 13:51:09 +01:00 committed by GitHub
parent ed0f63327d
commit dc5cc1dead
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -749,20 +749,20 @@ button event."
"Update the propertized `mode-line-process' for window ID."
(exwm--log "#x%x" id)
(let (help-echo cmd mode)
(cl-case exwm--input-mode
(line-mode
(setq mode "line"
help-echo "mouse-1: Switch to char-mode"
cmd (lambda ()
(interactive)
(exwm-input-release-keyboard id))))
(char-mode
(setq mode "char"
help-echo "mouse-1: Switch to line-mode"
cmd (lambda ()
(interactive)
(exwm-input-grab-keyboard id)))))
(with-current-buffer (exwm--id->buffer id)
(cl-case exwm--input-mode
(line-mode
(setq mode "line"
help-echo "mouse-1: Switch to char-mode"
cmd (lambda ()
(interactive)
(exwm-input-release-keyboard id))))
(char-mode
(setq mode "char"
help-echo "mouse-1: Switch to line-mode"
cmd (lambda ()
(interactive)
(exwm-input-grab-keyboard id)))))
(setq mode-line-process
`(": "
(:propertize ,mode