mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-30 16:07:59 +01:00
Select more sensible buffers after creating new windows
* exwm-layout.el (exwm-layout--refresh-other) (exwm-layout--refresh-workspace): When filling vacated windows select more sensible buffer by calling `switch-to-next-buffer' for newly created windows.
This commit is contained in:
parent
dbccda22a6
commit
fec85bb72a
1 changed files with 9 additions and 3 deletions
|
@ -296,7 +296,9 @@ selected by `other-buffer'."
|
||||||
(dolist (window windows)
|
(dolist (window windows)
|
||||||
(with-current-buffer (window-buffer window)
|
(with-current-buffer (window-buffer window)
|
||||||
(when (derived-mode-p 'exwm-mode)
|
(when (derived-mode-p 'exwm-mode)
|
||||||
(switch-to-prev-buffer window))))))
|
(if (window-prev-buffers window)
|
||||||
|
(switch-to-prev-buffer window)
|
||||||
|
(switch-to-next-buffer window)))))))
|
||||||
|
|
||||||
(defun exwm-layout--refresh-workspace (frame)
|
(defun exwm-layout--refresh-workspace (frame)
|
||||||
"Refresh workspace frame FRAME."
|
"Refresh workspace frame FRAME."
|
||||||
|
@ -346,14 +348,18 @@ selected by `other-buffer'."
|
||||||
;; Set some sensible buffer to vacated windows.
|
;; Set some sensible buffer to vacated windows.
|
||||||
(let ((exwm-layout--other-buffer-exclude-buffers covered-buffers))
|
(let ((exwm-layout--other-buffer-exclude-buffers covered-buffers))
|
||||||
(dolist (window vacated-windows)
|
(dolist (window vacated-windows)
|
||||||
(switch-to-prev-buffer window)))
|
(if (window-prev-buffers window)
|
||||||
|
(switch-to-prev-buffer window)
|
||||||
|
(switch-to-next-buffer window))))
|
||||||
;; Make sure windows floating / on other workspaces are excluded
|
;; Make sure windows floating / on other workspaces are excluded
|
||||||
(let ((exwm-layout--other-buffer-exclude-exwm-mode-buffers t))
|
(let ((exwm-layout--other-buffer-exclude-exwm-mode-buffers t))
|
||||||
(dolist (window (window-list frame 'nomini))
|
(dolist (window (window-list frame 'nomini))
|
||||||
(with-current-buffer (window-buffer window)
|
(with-current-buffer (window-buffer window)
|
||||||
(when (and (derived-mode-p 'exwm-mode)
|
(when (and (derived-mode-p 'exwm-mode)
|
||||||
(or exwm--floating-frame (not (eq frame exwm--frame))))
|
(or exwm--floating-frame (not (eq frame exwm--frame))))
|
||||||
(switch-to-prev-buffer window)))))
|
(if (window-prev-buffers window)
|
||||||
|
(switch-to-prev-buffer window)
|
||||||
|
(switch-to-next-buffer window))))))
|
||||||
(exwm-layout--set-client-list-stacking)
|
(exwm-layout--set-client-list-stacking)
|
||||||
(xcb:flush exwm--connection)))
|
(xcb:flush exwm--connection)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue