diff options
author | Chris Feng <chris.w.feng@gmail.com> | 2015-08-06T06·41+0800 |
---|---|---|
committer | Chris Feng <chris.w.feng@gmail.com> | 2015-08-06T06·41+0800 |
commit | 1e36a22b3f5fd3867f29eaf3e1891422a3bb952c (patch) | |
tree | 277f57121b08558a192baa66fdf6fbecdac65eca /exwm.el | |
parent | 3fb90b9eaac752760fc32404cbd1574b8ef61669 (diff) |
Check buffer mode in exwm-reset
This should prevent users from misoperation.
Diffstat (limited to 'exwm.el')
-rw-r--r-- | exwm.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/exwm.el b/exwm.el index c8f10aff246d..18d8ddad8f9c 100644 --- a/exwm.el +++ b/exwm.el @@ -195,9 +195,10 @@ (defun exwm-reset () "Reset window to standard state: non-fullscreen, line-mode." (interactive) - (with-current-buffer (window-buffer (selected-window)) - (when exwm--fullscreen (exwm-layout-unset-fullscreen)) - (exwm-input-grab-keyboard))) + (with-current-buffer (window-buffer) + (when (and (eq major-mode 'exwm-mode) exwm--fullscreen) + (exwm-layout-unset-fullscreen) + (exwm-input-grab-keyboard)))) (defmacro exwm--with-current-id (id &rest body) "Evaluate BODY in the context of the buffer corresponding to window ID." |