; Comment layout algorithm.

This commit is contained in:
Adrián Medraño Calvo 2018-08-16 12:00:00 +00:00 committed by Chris Feng
parent f820217d00
commit d4a772f536

View file

@ -304,25 +304,31 @@ selected by `other-buffer'."
(or exwm-layout-show-all-buffers (or exwm-layout-show-all-buffers
;; Exclude X windows on other workspaces ;; Exclude X windows on other workspaces
(eq frame exwm--frame))) (eq frame exwm--frame)))
(let ((windows (get-buffer-window-list (current-buffer) 'nomini frame))) (let (;; List of windows in current frame displaying the `exwm-mode'
;; buffers.
(windows (get-buffer-window-list (current-buffer) 'nomini
frame)))
(if (not windows) (if (not windows)
(when (eq frame exwm--frame) (when (eq frame exwm--frame)
;; Hide it if it was being shown in this workspace.
(exwm-layout--hide exwm--id)) (exwm-layout--hide exwm--id))
(let ((window (car windows))) (let ((window (car windows)))
(if (eq frame exwm--frame) (if (eq frame exwm--frame)
(when (exwm-workspace--active-p frame) (when (exwm-workspace--active-p frame)
;; Show it if `frame' is active.
(exwm-layout--show exwm--id window)) (exwm-layout--show exwm--id window))
;; It was last shown in other workspace; move it here.
(exwm-workspace-move-window frame exwm--id)) (exwm-workspace-move-window frame exwm--id))
;; Make sure this buffer is not displayed elsewhere. Note down ;; Vacate any other windows (in any workspace) showing this
;; windows displaying an EXWM-buffer now displayed elsewhere; we ;; `exwm-mode' buffer.
;; need to display with some other buffer there.
(setq vacated-windows (setq vacated-windows
(append vacated-windows (remove (append vacated-windows (remove
window window
(get-buffer-window-list (get-buffer-window-list
(current-buffer) 'nomini t)))) (current-buffer) 'nomini t))))
;; Note down when an EXWM-buffer is being covered by this ;; Note any `exwm-mode' buffer is being covered by another
;; buffer; we don't want it to reappear in some vacated window. ;; `exwm-mode' buffer. We want to avoid that `exwm-mode'
;; buffer to be reappear in any of the vacated windows.
(let ((prev-buffer (car-safe (let ((prev-buffer (car-safe
(car-safe (window-prev-buffers window))))) (car-safe (window-prev-buffers window)))))
(and (and