mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-30 16:07:59 +01:00
Fix click-to-focus on multi-monitor settings
* exwm-input.el (exwm-input--on-ButtonPress): [click-to-focus] Switch to the corresponding workspace if necessary.
This commit is contained in:
parent
4ad76b879d
commit
f685de12d4
1 changed files with 15 additions and 1 deletions
|
@ -187,8 +187,22 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
|
||||||
(exwm-floating--start-moveresize event))
|
(exwm-floating--start-moveresize event))
|
||||||
(t
|
(t
|
||||||
;; Click to focus
|
;; Click to focus
|
||||||
(let ((window (get-buffer-window (exwm--id->buffer event) t)))
|
(let ((window (get-buffer-window (exwm--id->buffer event) t))
|
||||||
|
frame)
|
||||||
(unless (eq window (selected-window))
|
(unless (eq window (selected-window))
|
||||||
|
(setq frame (window-frame window))
|
||||||
|
(unless (eq frame exwm-workspace--current)
|
||||||
|
(if (memq frame exwm-workspace--list)
|
||||||
|
;; The X window is on another workspace
|
||||||
|
(exwm-workspace-switch
|
||||||
|
(cl-position frame exwm-workspace--list))
|
||||||
|
(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))))))
|
||||||
(select-window window)))
|
(select-window window)))
|
||||||
;; The event should be replayed
|
;; The event should be replayed
|
||||||
(setq mode xcb:Allow:ReplayPointer))))
|
(setq mode xcb:Allow:ReplayPointer))))
|
||||||
|
|
Loading…
Reference in a new issue