about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2015-08-17T09·56+0800
committerChris Feng <chris.w.feng@gmail.com>2015-08-17T09·56+0800
commit5882015eb5a21cb859794388e21d6dc023764480 (patch)
treefa109d1c0131b6d57020988a15725cf2769d87fa
parent7120291197fb5ceb032671ba02345d181c77399d (diff)
parent2d07429d0f2e77054b565926ac6c8b7f592f8a44 (diff)
Merge branch 'pipcet-move-window-fix'
-rw-r--r--exwm-workspace.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 09112d2d6556..7ac1fecb755f 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -168,12 +168,14 @@ The optional FORCE option is for internal use only."
   (unless id (setq id (exwm--buffer->id (window-buffer))))
   (unless (and (<= 0 index) (< index exwm-workspace-number))
     (user-error "[EXWM] Workspace index out of range: %d" index))
-  (when (/= exwm-workspace-current-index index)
+  (with-current-buffer (exwm--id->buffer id)
     (let ((frame (elt exwm-workspace--list index)))
-      (with-current-buffer (exwm--id->buffer id)
+      (when (not (equal exwm--frame frame))
+        (let ((name (replace-regexp-in-string "^\\s-*" "" (buffer-name))))
+          (exwm-workspace-rename-buffer (if (= index exwm-workspace-current-index)
+                                            name
+                                          (concat " " name))))
         (setq exwm--frame frame)
-        (exwm-workspace-rename-buffer
-         (concat " " (replace-regexp-in-string "^\\s-*" "" (buffer-name))))
         (if exwm--floating-frame
             ;; Move the floating frame is enough
             (progn