Fix exwm-workspace-switch-to-buffer

* exwm-workspace.el (exwm-workspace-switch-to-buffer): Select the floating
frame when switching to a floating X window buffer.
This commit is contained in:
Chris Feng 2016-02-25 18:36:54 +08:00
parent b400ae6eba
commit 84a9041b20

View file

@ -399,10 +399,19 @@ The optional FORCE option is for internal use only."
(rename-buffer (concat " " (buffer-name)))))))))) (rename-buffer (concat " " (buffer-name))))))))))
(when buffer-or-name (when buffer-or-name
(with-current-buffer buffer-or-name (with-current-buffer buffer-or-name
(if (and (eq major-mode 'exwm-mode) (if (eq major-mode 'exwm-mode)
(not (eq exwm--frame exwm-workspace--current))) ;; EXWM buffer.
(if (eq exwm--frame exwm-workspace--current)
;; On the current workspace.
(if (not exwm--floating-frame)
(switch-to-buffer buffer-or-name)
;; Select the floating frame.
(select-frame-set-input-focus exwm--floating-frame)
(select-window (frame-root-window exwm--floating-frame)))
;; On another workspace.
(exwm-workspace-move-window exwm-workspace-current-index (exwm-workspace-move-window exwm-workspace-current-index
exwm--id) exwm--id))
;; Ordinary buffer.
(switch-to-buffer buffer-or-name))))) (switch-to-buffer buffer-or-name)))))
(defun exwm-workspace-rename-buffer (newname) (defun exwm-workspace-rename-buffer (newname)