about summary refs log tree commit diff
path: root/exwm-workspace.el
diff options
context:
space:
mode:
authorAdrián Medraño Calvo <adrian@medranocalvo.com>2016-07-17T12·00+0000
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2016-07-17T12·00+0000
commit90185457261eb77ac80609d5d219e0837e81af82 (patch)
treead36307ae0ba561a01d20b5ec12a37ef9ff07c4f /exwm-workspace.el
parent8e2da00b6e7e530a53b584184dc94b9366ae7c69 (diff)
New function exwm-workspace--workspace-p
	* exwm-workspace.el (exwm-workspace--workspace-p): New function.
	* exwm-input.el (exwm-input--on-ButtonPress):
	* exwm-workspace.el (exwm-workspace-switch):
	* exwm-layout.el (exwm-layout--refresh): Use it.
Diffstat (limited to 'exwm-workspace.el')
-rw-r--r--exwm-workspace.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index a3f4c2e75b0b..e2df37ede98e 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -40,6 +40,10 @@ NIL if FRAME is not a workspace"
   "Retrieve total number of workspaces."
   (length exwm-workspace--list))
 
+(defsubst exwm-workspace--workspace-p (frame)
+  "Return t if FRAME is a workspace."
+  (memq frame exwm-workspace--list))
+
 (defvar exwm-workspace--switch-map
   (let ((map (make-sparse-keymap)))
     (define-key map [t] (lambda () (interactive)))
@@ -334,7 +338,7 @@ The optional FORCE option is for internal use only."
                                :stack-mode xcb:StackMode:Above))))
         (setq exwm-workspace--current frame
               exwm-workspace-current-index index)
-        (unless (memq (selected-frame) exwm-workspace--list)
+        (unless (exwm-workspace--workspace-p (selected-frame))
           ;; Save the floating frame window selected on the previous workspace.
           (set-frame-parameter (with-current-buffer (window-buffer)
                                  exwm--frame)