Add `exwm-workspace--position' helper

* exwm-workspace.el (exwm-workspace--position): New function.
	* exwm-layout.el (exwm-layout--refresh):
	* exwm-input.el (exwm-input--on-ButtonPress):
	* exwm-workspace.el (exwm-workspace--update-switch-history):
	* exwm.el (exwm--on-ClientMessage, exwm-workspace--init): Use it.
This commit is contained in:
Adrián Medraño Calvo 2016-07-17 12:00:00 +00:00
parent cd1372eaec
commit ed6a18a697
4 changed files with 16 additions and 7 deletions

View file

@ -179,6 +179,7 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
(declare-function exwm-floating--start-moveresize "exwm-floating.el"
(id &optional type))
(declare-function exwm-workspace--position "exwm-workspace.el" (frame))
(defvar exwm-workspace--list)
@ -208,14 +209,14 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
(if (memq frame exwm-workspace--list)
;; The X window is on another workspace
(exwm-workspace-switch
(cl-position frame exwm-workspace--list))
(exwm-workspace--position frame))
(with-current-buffer (window-buffer window)
(when (and (eq major-mode 'exwm-mode)
(not (eq exwm--frame
exwm-workspace--current)))
;; The floating X window is on another workspace
(exwm-workspace-switch
(cl-position exwm--frame exwm-workspace--list))))))
(exwm-workspace--position exwm--frame))))))
;; It has been reported that the `window' may have be deleted
(if (window-live-p window)
(select-window window)