Add helper for counting number of workspaces

* exwm-workspace.el (exwm-workspace--count): New function.
	* exwm-randr.el (exwm-randr--refresh):
	* exwm-workspace.el (exwm-workspace--switch-map)
	(exwm-workspace--update-switch-history, exwm-workspace-switch)
	(exwm-workspace-move-window, exwm-workspace--init)
	(exwm-workspace--post-init): Use it.
This commit is contained in:
Adrián Medraño Calvo 2016-07-17 12:00:00 +00:00
parent ed6a18a697
commit 8e2da00b6e
2 changed files with 20 additions and 15 deletions

View file

@ -55,11 +55,11 @@
"Normal hook run when the RandR module just refreshed.")
(defvar exwm-workspace--fullscreen-frame-count)
(defvar exwm-workspace-number)
(defvar exwm-workspace--list)
(declare-function exwm-workspace--update-workareas "exwm-workspace.el" ())
(declare-function exwm-workspace--count "exwm-workspace.el")
(declare-function exwm-workspace--set-fullscreen "exwm-workspace.el" (frame))
(declare-function exwm-workspace--update-workareas "exwm-workspace.el" ())
(declare-function exwm-workspace--set-desktop-geometry "exwm-workspace.el" ())
(defun exwm-randr--refresh ()
@ -97,7 +97,7 @@
(when exwm-workspace--fullscreen-frame-count
;; Not all workspaces are fullscreen; reset this counter.
(setq exwm-workspace--fullscreen-frame-count 0))
(dotimes (i exwm-workspace-number)
(dotimes (i (exwm-workspace--count))
(let* ((output (plist-get exwm-randr-workspace-output-plist i))
(geometry (lax-plist-get output-plist output))
(frame (elt exwm-workspace--list i)))