[clfswm-cvs] r220 - in clfswm: . src

Philippe Brochard pbrochard at common-lisp.net
Tue May 5 20:17:31 UTC 2009


Author: pbrochard
Date: Tue May  5 16:17:31 2009
New Revision: 220

Log:
reorder-child, reorder-brother: Reinitialise on circulate type change child to brother or brother to child.

Modified:
   clfswm/ChangeLog
   clfswm/src/clfswm-circulate-mode.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Tue May  5 16:17:31 2009
@@ -1,5 +1,9 @@
 2009-05-05  Philippe Brochard  <pbrochard at common-lisp.net>
 
+	* src/clfswm-circulate-mode.lisp (reorder-child)
+	(reorder-brother): Reinitialise on circulate type change
+	child to brother or brother to child.
+
 	* src/*.lisp (*): Use map-window instead of xlib:map-window. So
 	calls xlib:display-finish-output on each map-request. So speed up
 	the window display.

Modified: clfswm/src/clfswm-circulate-mode.lisp
==============================================================================
--- clfswm/src/clfswm-circulate-mode.lisp	(original)
+++ clfswm/src/clfswm-circulate-mode.lisp	Tue May  5 16:17:31 2009
@@ -54,11 +54,26 @@
   "Leave the circulate mode"
   (throw 'exit-circulate-loop nil))
 
+
+
+(defun reset-circulate-child ()
+  (setf *circulate-hit* 0
+	*circulate-parent* nil
+	*circulate-orig* (frame-child *current-child*)))
+
+(defun reset-circulate-brother ()
+  (setf *circulate-parent* (find-parent-frame *current-child*))
+  (when (frame-p *circulate-parent*)
+    (setf *circulate-orig* (frame-child *circulate-parent*))))
+
+
+
 (defun reorder-child (direction)
   (with-slots (child) *current-child*
-    (when *circulate-orig*
-      (let ((elem (nth (mod  (incf *circulate-hit* direction) (length *circulate-orig*)) *circulate-orig*)))
-	(setf child (nconc (list elem) (remove elem *circulate-orig*))))))
+    (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))
 
@@ -69,6 +84,8 @@
     (if frame-is-root?
 	(hide-all *current-root*)
 	(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*)))
@@ -79,16 +96,6 @@
 
 
 
-(defun reset-circulate-child ()
-  (setf *circulate-hit* 0
-	*circulate-parent* nil
-	*circulate-orig* (frame-child *current-child*)))
-
-(defun reset-circulate-brother ()
-  (setf *circulate-parent* (find-parent-frame *current-child*))
-  (when (frame-p *circulate-parent*)
-    (setf *circulate-orig* (frame-child *circulate-parent*))))
-
 
 
 (defun circulate-select-next-child ()




More information about the clfswm-cvs mailing list