about summary refs log tree commit diff
path: root/exwm-workspace.el
diff options
context:
space:
mode:
Diffstat (limited to 'exwm-workspace.el')
-rw-r--r--exwm-workspace.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 5fae713f5709..d2619eed94f8 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -219,10 +219,11 @@ The optional FORCE option is for internal use only."
   (let ((buffer (read-buffer "Switch to window: " nil t)))
     (when buffer
       (with-current-buffer buffer
-        (when (and (eq major-mode 'exwm-mode)
-                   (not (eq exwm--frame exwm-workspace--current)))
-          (exwm-workspace-move-window exwm-workspace-current-index
-                                      exwm--id)))))
+        (if (and (eq major-mode 'exwm-mode)
+                 (not (eq exwm--frame exwm-workspace--current)))
+            (exwm-workspace-move-window exwm-workspace-current-index
+                                        exwm--id)
+          (switch-to-buffer buffer)))))
   ;; Hide buffers on other workspaces
   (dolist (pair exwm--id-buffer-alist)
     (with-current-buffer (cdr pair)