mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-23 13:07:59 +01:00
Check buffer mode in exwm-reset
This should prevent users from misoperation.
This commit is contained in:
parent
3fb90b9eaa
commit
1e36a22b3f
2 changed files with 5 additions and 8 deletions
|
@ -111,11 +111,7 @@ The optional FORCE option is for internal use only."
|
||||||
(unless (and (<= 0 index) (< index exwm-workspace-number))
|
(unless (and (<= 0 index) (< index exwm-workspace-number))
|
||||||
(user-error "[EXWM] Workspace index out of range: %d" index))
|
(user-error "[EXWM] Workspace index out of range: %d" index))
|
||||||
(when (or force (/= exwm-workspace-current-index index))
|
(when (or force (/= exwm-workspace-current-index index))
|
||||||
;; Exit fullscreen mode
|
(exwm-reset) ;exit full screen
|
||||||
(with-current-buffer (window-buffer)
|
|
||||||
(when (and (eq major-mode 'exwm-mode) exwm--fullscreen)
|
|
||||||
(exwm-layout-unset-fullscreen)
|
|
||||||
(exwm-input-grab-keyboard)))
|
|
||||||
(let ((frame (elt exwm-workspace--list index)))
|
(let ((frame (elt exwm-workspace--list index)))
|
||||||
(setq exwm-workspace--current frame
|
(setq exwm-workspace--current frame
|
||||||
exwm-workspace-current-index index)
|
exwm-workspace-current-index index)
|
||||||
|
|
7
exwm.el
7
exwm.el
|
@ -195,9 +195,10 @@
|
||||||
(defun exwm-reset ()
|
(defun exwm-reset ()
|
||||||
"Reset window to standard state: non-fullscreen, line-mode."
|
"Reset window to standard state: non-fullscreen, line-mode."
|
||||||
(interactive)
|
(interactive)
|
||||||
(with-current-buffer (window-buffer (selected-window))
|
(with-current-buffer (window-buffer)
|
||||||
(when exwm--fullscreen (exwm-layout-unset-fullscreen))
|
(when (and (eq major-mode 'exwm-mode) exwm--fullscreen)
|
||||||
(exwm-input-grab-keyboard)))
|
(exwm-layout-unset-fullscreen)
|
||||||
|
(exwm-input-grab-keyboard))))
|
||||||
|
|
||||||
(defmacro exwm--with-current-id (id &rest body)
|
(defmacro exwm--with-current-id (id &rest body)
|
||||||
"Evaluate BODY in the context of the buffer corresponding to window ID."
|
"Evaluate BODY in the context of the buffer corresponding to window ID."
|
||||||
|
|
Loading…
Reference in a new issue