[clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1212-59-geff5cfd

Philippe Brochard pbrochard at common-lisp.net
Sat Apr 5 19:20:49 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CLFSWM - A(nother) Common Lisp FullScreen Window Manager".

The branch, master has been updated
       via  eff5cfda6e50e2a75854a23cf883050f07fa6f34 (commit)
      from  acac7da7e5c3a7989f972249295872f179edaa8a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit eff5cfda6e50e2a75854a23cf883050f07fa6f34
Author: Philippe Brochard <pbrochard at common-lisp.net>
Date:   Sat Apr 5 23:20:43 2014 +0200

    Do not remove a child if it's the last child in *root-frame*

diff --git a/src/clfswm-util.lisp b/src/clfswm-util.lisp
index bf45aee..102b522 100644
--- a/src/clfswm-util.lisp
+++ b/src/clfswm-util.lisp
@@ -406,16 +406,32 @@ Write (defparameter *contrib-dir* \"/usr/local/lib/clfswm/\") in ~A.~%"
         (show-all-children t))
       (current-child))))
 
+
+
+(defun count-child-in-root (child root)
+  (let ((count 0))
+    (with-all-children (root c)
+      (when (child-equal-p c child)
+        (incf count)))
+    count))
+
+
+(defun find-a-last-child (child)
+  (with-all-children (child c)
+    (when (= (count-child-in-root c *root-frame*) 1)
+      (return-from find-a-last-child t))))
+
 (defun remove-current-child ()
   "Remove the current child from its parent frame"
   (unless (child-root-p (current-child))
-    (let ((parent (find-parent-frame (current-child))))
-      (hide-all (current-child))
-      (remove-child-in-frame (current-child) (find-parent-frame (current-child) (find-current-root)))
-      (when parent
-        (setf (current-child) parent))
-      (show-all-children t)
-      (leave-second-mode))))
+    (unless (find-a-last-child (current-child))
+      (let ((parent (find-parent-frame (current-child))))
+        (hide-all (current-child))
+        (remove-child-in-frame (current-child) (find-parent-frame (current-child) (find-current-root)))
+        (when parent
+          (setf (current-child) parent))))
+    (show-all-children t)
+    (leave-second-mode)))
 
 (defun delete-current-child ()
   "Delete the current child and its children in all frames"

-----------------------------------------------------------------------

Summary of changes:
 src/clfswm-util.lisp |   30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
CLFSWM - A(nother) Common Lisp FullScreen Window Manager



More information about the clfswm-cvs mailing list