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

    Update the current workspace index when deleting
    
    * exwm-workspace.el (exwm-workspace--remove-frame-as-workspace): Update
    the current workspace index, even if we're not deleting the current
    workspace.
---
 exwm-workspace.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/exwm-workspace.el b/exwm-workspace.el
index d237a7eacd..61becb00f3 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -1411,8 +1411,11 @@ When QUIT is non-nil cleanup avoid communicating with 
the X server."
           (when (memq other-frame following-frames)
             (exwm-workspace--set-desktop (car pair)))))
       ;; If the current workspace is deleted, switch to next one.
-      (when (eq frame exwm-workspace--current)
-        (exwm-workspace-switch next-frame))))
+      (if (eq frame exwm-workspace--current)
+          (exwm-workspace-switch next-frame)
+        ;; Otherwise, update the workspace index.
+        (setq exwm-workspace-current-index
+              (exwm-workspace--position next-frame)))))
   ;; Reparent out the frame.
   (let ((outer-id (frame-parameter frame 'exwm-outer-id)))
     (xcb:+request exwm--connection

Reply via email to