[clfswm-cvs] r225 - in clfswm: . src
Philippe Brochard
pbrochard at common-lisp.net
Sat May 9 22:19:19 UTC 2009
Author: pbrochard
Date: Sat May 9 18:19:18 2009
New Revision: 225
Log:
reorder-child, reorder-brother: Handle empty frames.
Modified:
clfswm/ChangeLog
clfswm/src/clfswm-circulate-mode.lisp
Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog (original)
+++ clfswm/ChangeLog Sat May 9 18:19:18 2009
@@ -1,5 +1,8 @@
2009-05-10 Philippe Brochard <pbrochard at common-lisp.net>
+ * src/clfswm-circulate-mode.lisp (reorder-child)
+ (reorder-brother): Handle empty frames.
+
* src/clfswm-util.lisp (frame-toggle-maximize): Redisplay only the
parent frame of the current frame.
Modified: clfswm/src/clfswm-circulate-mode.lisp
==============================================================================
--- clfswm/src/clfswm-circulate-mode.lisp (original)
+++ clfswm/src/clfswm-circulate-mode.lisp Sat May 9 18:19:18 2009
@@ -72,10 +72,12 @@
(with-slots (child) *current-child*
(unless *circulate-orig*
(reset-circulate-child))
- (let ((elem (nth (mod (incf *circulate-hit* direction) (length *circulate-orig*)) *circulate-orig*)))
- (setf child (nconc (list elem) (remove elem *circulate-orig*)))))
- (show-all-children)
- (draw-circulate-mode-window))
+ (let ((len (length *circulate-orig*)))
+ (when (plusp len)
+ (let ((elem (nth (mod (incf *circulate-hit* direction) len) *circulate-orig*)))
+ (setf child (nconc (list elem) (remove elem *circulate-orig*)))))
+ (show-all-children)
+ (draw-circulate-mode-window))))
(defun reorder-brother (direction)
@@ -86,11 +88,13 @@
(select-current-frame nil))
(unless (and *circulate-orig* *circulate-parent*)
(reset-circulate-brother))
- (let ((elem (nth (mod (incf *circulate-hit* direction) (length *circulate-orig*)) *circulate-orig*)))
- (setf (frame-child *circulate-parent*) (nconc (list elem) (remove elem *circulate-orig*))
- *current-child* (frame-selected-child *circulate-parent*)))
- (when frame-is-root?
- (setf *current-root* *current-child*))
+ (let ((len (length *circulate-orig*)))
+ (when (plusp len)
+ (let ((elem (nth (mod (incf *circulate-hit* direction) len) *circulate-orig*)))
+ (setf (frame-child *circulate-parent*) (nconc (list elem) (remove elem *circulate-orig*))
+ *current-child* (frame-selected-child *circulate-parent*)))
+ (when frame-is-root?
+ (setf *current-root* *current-child*))))
(show-all-children *current-root*)
(draw-circulate-mode-window)))
More information about the clfswm-cvs
mailing list