[clfswm-cvs] r148 - in clfswm: . src
pbrochard at common-lisp.net
pbrochard at common-lisp.net
Thu Jun 12 11:21:47 UTC 2008
Author: pbrochard
Date: Thu Jun 12 07:21:46 2008
New Revision: 148
Modified:
clfswm/ChangeLog
clfswm/src/clfswm-internal.lisp
clfswm/src/tools.lisp
Log:
focus-child: Algorithm change to raise only the selected child.
Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog (original)
+++ clfswm/ChangeLog Thu Jun 12 07:21:46 2008
@@ -1,3 +1,8 @@
+2008-06-12 Philippe Brochard <pbrochard at common-lisp.net>
+
+ * src/clfswm-internal.lisp (focus-child): Algorithm change to
+ raise only the selected child.
+
2008-06-08 Philippe Brochard <pbrochard at common-lisp.net>
* src/clfswm-internal.lisp (raise-p-list, show-all-children):
Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp (original)
+++ clfswm/src/clfswm-internal.lisp Thu Jun 12 07:21:46 2008
@@ -628,15 +628,14 @@
-
(defun focus-child (child parent)
"Focus child - Return true if something has change"
(when (and (frame-p parent)
(member child (frame-child parent)))
- (when (not (equal child (frame-selected-child parent)))
- (loop until (equal child (frame-selected-child parent))
- do (setf (frame-child parent) (rotate-list (frame-child parent))))
- t)))
+ (when (not (equal child (frame-selected-child parent)))
+ (with-slots ((parent-child child) selected-pos) parent
+ (setf parent-child (nth-insert selected-pos child (remove child parent-child))))
+ t)))
(defun focus-child-rec (child parent)
"Focus child and its parents - Return true if something has change"
Modified: clfswm/src/tools.lisp
==============================================================================
--- clfswm/src/tools.lisp (original)
+++ clfswm/src/tools.lisp Thu Jun 12 07:21:46 2008
@@ -37,6 +37,7 @@
:setf/=
:in-corner
:create-symbol
+ :nth-insert
:split-string
:expand-newline
:ensure-list
@@ -179,6 +180,15 @@
(intern (string-upcase (apply #'concatenate 'string names))))
+
+(defun nth-insert (n elem list)
+ "Insert elem in (nth n list)"
+ (nconc (subseq list 0 n)
+ (list elem)
+ (subseq list n)))
+
+
+
(defun split-string (string &optional (separator #\Space))
"Return a list from a string splited at each separators"
(loop for i = 0 then (1+ j)
More information about the clfswm-cvs
mailing list