mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 06:48:00 +01:00
Allow switching to a workspace by selecting one X window on it
* exwm-workspace.el (exwm-workspace-switch-to-buffer): Only allows it when `exwm-layout-show-all-buffers' is nil.
This commit is contained in:
parent
851ed8c280
commit
19515dc074
1 changed files with 12 additions and 2 deletions
|
@ -779,6 +779,8 @@ INDEX must not exceed the current number of workspaces."
|
||||||
(xcb:flush exwm--connection)))
|
(xcb:flush exwm--connection)))
|
||||||
(setq exwm-workspace--switch-history-outdated t)))
|
(setq exwm-workspace--switch-history-outdated t)))
|
||||||
|
|
||||||
|
(defvar exwm-layout-show-all-buffers)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun exwm-workspace-switch-to-buffer (buffer-or-name)
|
(defun exwm-workspace-switch-to-buffer (buffer-or-name)
|
||||||
"Make the current Emacs window display another buffer."
|
"Make the current Emacs window display another buffer."
|
||||||
|
@ -818,8 +820,16 @@ INDEX must not exceed the current number of workspaces."
|
||||||
(select-frame-set-input-focus exwm--floating-frame)
|
(select-frame-set-input-focus exwm--floating-frame)
|
||||||
(select-window (frame-root-window exwm--floating-frame)))
|
(select-window (frame-root-window exwm--floating-frame)))
|
||||||
;; On another workspace.
|
;; On another workspace.
|
||||||
(exwm-workspace-move-window exwm-workspace--current
|
(if exwm-layout-show-all-buffers
|
||||||
exwm--id))
|
(exwm-workspace-move-window exwm-workspace--current
|
||||||
|
exwm--id)
|
||||||
|
(let ((window (get-buffer-window buffer-or-name exwm--frame)))
|
||||||
|
(if window
|
||||||
|
(set-frame-parameter exwm--frame
|
||||||
|
'exwm-selected-window window)
|
||||||
|
(set-window-buffer (frame-selected-window exwm--frame)
|
||||||
|
buffer-or-name)))
|
||||||
|
(exwm-workspace-switch exwm--frame)))
|
||||||
;; Ordinary buffer.
|
;; Ordinary buffer.
|
||||||
(switch-to-buffer buffer-or-name)))))
|
(switch-to-buffer buffer-or-name)))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue