about summary refs log tree commit diff
path: root/exwm-manage.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-07-30T02·09+0800
committerChris Feng <chris.w.feng@gmail.com>2016-07-30T02·09+0800
commitba0f41db1b377196af8aa6607ef215e48a3daa26 (patch)
tree92da06bc9606a0cefa5ec0c26c954f6cb58e962c /exwm-manage.el
parent9f68fbd906ca14856a70a3c3b535188a670d01f4 (diff)
; * exwm-manage.el (exwm-manage--manage-window): Check the value range
; of _NET_WM_DESKTOP.
Diffstat (limited to 'exwm-manage.el')
-rw-r--r--exwm-manage.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/exwm-manage.el b/exwm-manage.el
index 9e05ea24825e..c083229c2dbe 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -98,6 +98,7 @@ corresponding buffer.")
 (declare-function exwm-workspace--current-height "exwm-workspace.el")
 (declare-function exwm-workspace--current-width  "exwm-workspace.el")
 (declare-function exwm-workspace--set-desktop "exwm-workspace.el" (id))
+(declare-function exwm-workspace--count "exwm-workspace.el" ())
 (declare-function exwm-workspace-move-window "exwm-workspace.el"
                   (frame-or-index &optional id))
 
@@ -254,7 +255,10 @@ corresponding buffer.")
             desktop)
         (when reply
           (setq desktop (slot-value reply 'value)))
-        (if (and desktop (/= desktop exwm-workspace-current-index))
+        (if (and desktop
+                 (/= desktop exwm-workspace-current-index)
+                 ;; Check the range.
+                 (< desktop (exwm-workspace--count)))
             (exwm-workspace-move-window desktop id)
           (exwm-workspace--set-desktop id)))
       (with-current-buffer (exwm--id->buffer id)