about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdrián Medraño Calvo <adrian@medranocalvo.com>2020-05-06T00·00+0000
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2020-05-06T00·00+0000
commitc7c42582b7342f20c22b8a040eab72d3ce9f37b5 (patch)
tree2798195772239f9350cb125905b8c80d5c2b0baa
parent21a73419724fe642ad3affc12fb6e901e554a243 (diff)
Prevent jumping back to previous workspace
	* exwm-workspace.el (exwm-workspace-switch): Focus out old frame
	before switching to the new one to prevent jumping back to
	previous workspace.
-rw-r--r--exwm-workspace.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index f63a0a36ebaf..cff17f3a113a 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -587,6 +587,11 @@ for internal use only."
     (when (or force (not (eq frame exwm-workspace--current)))
       (unless (window-live-p window)
         (setq window (frame-selected-window frame)))
+    (when (and (not (eq frame old-frame))
+               (frame-live-p old-frame))
+      (with-selected-frame old-frame
+        (funcall exwm-workspace--original-handle-focus-out
+                 (list 'focus-out frame))))
       ;; Raise this frame.
       (xcb:+request exwm--connection
           (make-instance 'xcb:ConfigureWindow
@@ -680,11 +685,6 @@ for internal use only."
                              :dst-x (/ (frame-pixel-width frame) 2)
                              :dst-y (/ (frame-pixel-height frame) 2)))
           (xcb:flush exwm--connection))))
-    (when (and (not (eq frame old-frame))
-               (frame-live-p old-frame))
-      (with-selected-frame old-frame
-        (funcall exwm-workspace--original-handle-focus-out
-                 (list 'focus-out frame))))
     (funcall exwm-workspace--original-handle-focus-in (list 'focus-in frame))
     (run-hooks 'exwm-workspace-switch-hook)))