about summary refs log tree commit diff
path: root/exwm-workspace.el
diff options
context:
space:
mode:
authorAdrián Medraño Calvo <adrian@medranocalvo.com>2016-03-19T00·00+0000
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2016-03-19T00·00+0000
commit3763195fe3205090e1f405970421662523b7df7e (patch)
tree426995d6e0079b09de9a57d6ca99d0169f7613dc /exwm-workspace.el
parent8a1c3761e4eab018a001dcc522112269f83ba279 (diff)
Use `buffer-predicate' frame parameter to prevent switching to visible EXWM buffers
* exwm-layout.el (exwm-layout--other-buffer-predicate): New
function to be set as `buffer-predicate' frame parameter.
* exwm-workspace.el (exwm-workspace--init): Use above function on
workspace frames.
Diffstat (limited to 'exwm-workspace.el')
-rw-r--r--exwm-workspace.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index b2fb648304..c9a57f5a3d 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -235,6 +235,7 @@ The optional FORCE option is for internal use only."
 (declare-function exwm-layout--show "exwm-layout.el" (id &optional window))
 (declare-function exwm-layout--hide "exwm-layout.el" (id))
 (declare-function exwm-layout--refresh "exwm-layout.el")
+(declare-function exwm-layout--other-buffer-predicate "exwm-layout.el" (buffer))
 
 ;;;###autoload
 (defun exwm-workspace-move-window (index &optional id)
@@ -684,6 +685,9 @@ The optional FORCE option is for internal use only."
     ;; The default behavior of `display-buffer' (indirectly called by
     ;; `minibuffer-completion-help') is not correct here.
     (cl-pushnew '(exwm-workspace--display-buffer) display-buffer-alist))
+  ;; Prevent `other-buffer' from selecting already displayed EXWM buffers.
+  (modify-all-frames-parameters
+   '((buffer-predicate . exwm-layout--other-buffer-predicate)))
   ;; Configure workspaces
   (dolist (i exwm-workspace--list)
     (let ((outer-id (string-to-number (frame-parameter i 'outer-window-id)))