branch: externals/exwm
commit f5a12904fa23b5a033bd50878727af926aa3740e
Author: Steven Allen <[email protected]>
Commit: Steven Allen <[email protected]>

    Revert "Don't warp the cursor when entering a window with the mouse"
    
    This reverts commit cd5dd14d51085f10e938966f19619273a48b685c.
    
    This fix works if we enter the floating window with the mouse, but not
    if we enter the floating window's mode-line with the mouse as that takes
    the exwm-input--update-focus codepath.
---
 exwm-input.el | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/exwm-input.el b/exwm-input.el
index e3146f83dc..c34b62d78d 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -147,7 +147,6 @@ This value should always be overwritten.")
 Current buffer will be the `exwm-mode' buffer when this hook runs.")
 
 (defvar exwm-workspace--current)
-(defvar exwm-workspace-warp-cursor)
 (declare-function exwm-floating--do-moveresize "exwm-floating.el"
                   (data _synthetic))
 (declare-function exwm-floating--start-moveresize "exwm-floating.el"
@@ -254,15 +253,14 @@ ARGS are additional arguments to CALLBACK."
         (setq frame (window-frame window)
               frame-xid (frame-parameter frame 'exwm-id))
         (unless (eq frame exwm-workspace--current)
-          (let (exwm-workspace-warp-cursor)
-            (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))))))
+          (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)))))
         ;; Send a fake MotionNotify event to Emacs.
         (setq edges (exwm--window-inside-pixel-edges window)
               fake-evt (make-instance 'xcb:MotionNotify

Reply via email to