emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/exwm 1e36a22 13/64: Check buffer mode in exwm-reset


From: Chris Feng
Subject: [elpa] externals/exwm 1e36a22 13/64: Check buffer mode in exwm-reset
Date: Thu, 17 Sep 2015 23:17:54 +0000

branch: externals/exwm
commit 1e36a22b3f5fd3867f29eaf3e1891422a3bb952c
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Check buffer mode in exwm-reset
    
    This should prevent users from misoperation.
---
 exwm-workspace.el |    6 +-----
 exwm.el           |    7 ++++---
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/exwm-workspace.el b/exwm-workspace.el
index ed06f64..d700f41 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -111,11 +111,7 @@ The optional FORCE option is for internal use only."
     (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))
-      ;; Exit fullscreen mode
-      (with-current-buffer (window-buffer)
-        (when (and (eq major-mode 'exwm-mode) exwm--fullscreen)
-          (exwm-layout-unset-fullscreen)
-          (exwm-input-grab-keyboard)))
+      (exwm-reset)                      ;exit full screen
       (let ((frame (elt exwm-workspace--list index)))
         (setq exwm-workspace--current frame
               exwm-workspace-current-index index)
diff --git a/exwm.el b/exwm.el
index c8f10af..18d8dda 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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]