about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-08-31T11·18+0800
committerChris Feng <chris.w.feng@gmail.com>2016-08-31T11·18+0800
commitb4517fbfa058e38b9c229d3e76674221d89a2e2b (patch)
tree0774dff4bd725f28b5ef26c03f6cd1764d564204
parent9105f2312161a402ab7e7b4d6e8bcf127cbf51f5 (diff)
Force using visible buffers in `other-buffer'
* exwm-floating.el (exwm-floating--set-floating):
* exwm-workspace.el (exwm-workspace-move-window):
Buffers visible on other frames should be treated as invisible.  One
side effect is visible buffers on the current frame is also taken into
account.
-rw-r--r--exwm-floating.el5
-rw-r--r--exwm-workspace.el2
2 files changed, 4 insertions, 3 deletions
diff --git a/exwm-floating.el b/exwm-floating.el
index 6f6cfecbfe4a..f2cc09be46f4 100644
--- a/exwm-floating.el
+++ b/exwm-floating.el
@@ -82,8 +82,9 @@ context of the corresponding buffer.")
 (defun exwm-floating--set-floating (id)
   "Make window ID floating."
   (let ((window (get-buffer-window (exwm--id->buffer id))))
-    (when window                        ;window in non-floating state
-      (set-window-buffer window (other-buffer)))) ;hide it first
+    (when window
+      ;; Hide the non-floating X window first.
+      (set-window-buffer window (other-buffer nil t))))
   (let* ((original-frame exwm-workspace--current)
          ;; Create new frame
          (frame (with-current-buffer
diff --git a/exwm-workspace.el b/exwm-workspace.el
index a99186ceb0f9..24a59f9fab07 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -747,7 +747,7 @@ INDEX must not exceed the current number of workspaces."
                                         exwm--floating-frame)))))
           ;; Move the X window container.
           (set-window-buffer (get-buffer-window (current-buffer) t)
-                             (other-buffer))
+                             (other-buffer nil t))
           (unless (eq frame exwm-workspace--current)
             ;; Clear the 'exwm-selected-window' frame parameter.
             (set-frame-parameter frame 'exwm-selected-window nil))