branch: externals/exwm
commit 5eb70b274e711f0c033cad6b7dc9c78a20452306
Author: LLLL Colonq <[email protected]>
Commit: GitHub <[email protected]>
exwm-input: Allow windows to be focused on mouse click (#181)
The `when-let*` introduced in d0b4b2a changed the logic of
`exwm-input--on-ButtonPress`. Previously, the check that `(not (eq frame
exwm-workspace-current))` did not surround the logic for calling
`select-window`.
* exwm-input.el (exwm-input--on-ButtonPress): Correctly select the window
on button press.
Co-authored-by: LLLL Colonq <llll@colonq>
---
exwm-input.el | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/exwm-input.el b/exwm-input.el
index bdb5b9c422..dda7e9dd1d 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -420,18 +420,18 @@ attempt later."
;; Click to focus
(setq fake-last-command t)
(when-let* ((window (get-buffer-window buffer t))
- (_(not (eq window (selected-window))))
- (frame (window-frame window))
- (_(not (eq frame exwm-workspace--current))))
- (if (exwm-workspace--workspace-p frame)
- ;; The X window is on another workspace
- (exwm-workspace-switch frame)
- (with-current-buffer buffer
- (when (and (derived-mode-p 'exwm-mode)
- (not (eq exwm--frame
- exwm-workspace--current)))
- ;; The floating X window is on another workspace
- (exwm-workspace-switch exwm--frame))))
+ (_(not (eq window (selected-window)))))
+ (when-let* ((frame (window-frame window))
+ (_(not (eq frame exwm-workspace--current))))
+ (if (exwm-workspace--workspace-p frame)
+ ;; The X window is on another workspace
+ (exwm-workspace-switch frame)
+ (with-current-buffer buffer
+ (when (and (derived-mode-p 'exwm-mode)
+ (not (eq exwm--frame
+ exwm-workspace--current)))
+ ;; The floating X window is on another workspace
+ (exwm-workspace-switch exwm--frame)))))
;; It has been reported that the `window' may have be deleted
(unless (window-live-p window)
(setq window (get-buffer-window buffer t)))