about summary refs log tree commit diff
path: root/exwm-workspace.el
diff options
context:
space:
mode:
Diffstat (limited to 'exwm-workspace.el')
-rw-r--r--exwm-workspace.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/exwm-workspace.el b/exwm-workspace.el
index b9cda2516051..e2dfa232f8b6 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -685,10 +685,12 @@ INDEX must not exceed the current number of workspaces."
 (defun exwm-workspace--set-desktop (id)
   "Set _NET_WM_DESKTOP for X window ID."
   (with-current-buffer (exwm--id->buffer id)
-    (xcb:+request exwm--connection
-        (make-instance 'xcb:ewmh:set-_NET_WM_DESKTOP
-                       :window id
-                       :data (exwm-workspace--position exwm--frame)))))
+    (let ((desktop (exwm-workspace--position exwm--frame)))
+      (setq exwm--desktop desktop)
+      (xcb:+request exwm--connection
+          (make-instance 'xcb:ewmh:set-_NET_WM_DESKTOP
+                         :window id
+                         :data desktop)))))
 
 ;;;###autoload
 (defun exwm-workspace-move-window (frame-or-index &optional id)