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

pbrochard at common-lisp.net pbrochard at common-lisp.net
Wed Apr 30 19:23:08 UTC 2008


Author: pbrochard
Date: Wed Apr 30 15:23:08 2008
New Revision: 102

Modified:
   clfswm/ChangeLog
   clfswm/src/bindings-second-mode.lisp
   clfswm/src/clfswm-internal.lisp
   clfswm/src/clfswm-util.lisp
Log:
paste-selection-no-clear: Prevent to paste a child on one of its own children. (this prevent a recursive bug).

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Wed Apr 30 15:23:08 2008
@@ -1,3 +1,11 @@
+2008-04-30  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* src/clfswm-util.lisp (paste-selection-no-clear): Prevent to
+	paste a child on one of its own children. (this prevent a
+	recursive bug).
+
+	* src/clfswm-internal.lisp (find-child-in-parent): New function.
+
 2008-04-29  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* src/clfswm-internal.lisp (show-all-children): Display unmanaged

Modified: clfswm/src/bindings-second-mode.lisp
==============================================================================
--- clfswm/src/bindings-second-mode.lisp	(original)
+++ clfswm/src/bindings-second-mode.lisp	Wed Apr 30 15:23:08 2008
@@ -241,9 +241,8 @@
 
 (define-second-key (#\b :mod-1) 'banish-pointer)
 
-(define-second-key (#\o) 'set-open-in-new-frame-in-parent-frame-nw-hook)
-(define-second-key (#\o :control) 'set-open-in-new-frame-in-root-frame-nw-hook)
-
+(define-second-key (#\o) 'set-open-in-new-frame-in-root-frame-nw-hook)
+(define-second-key (#\o :control) 'set-open-in-new-frame-in-parent-frame-nw-hook)
 
 ;;;; Escape
 (define-second-key ("Escape" :control :shift) 'delete-focus-window)

Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp	(original)
+++ clfswm/src/clfswm-internal.lisp	Wed Apr 30 15:23:08 2008
@@ -305,6 +305,17 @@
 	(return-from find-frame-by-number frame)))))
 
 
+(defun find-child-in-parent (child base)
+  "Return t if child is in base or in its parents"
+  (labels ((rec (base)
+	     (when (equal child base)
+	       (return-from find-child-in-parent t))
+	     (let ((parent (find-parent-frame base)))
+	       (when parent
+		 (rec parent)))))
+    (rec base)))
+
+
 
 
 (defun get-all-windows (&optional (root *root-frame*))

Modified: clfswm/src/clfswm-util.lisp
==============================================================================
--- clfswm/src/clfswm-util.lisp	(original)
+++ clfswm/src/clfswm-util.lisp	Wed Apr 30 15:23:08 2008
@@ -185,7 +185,8 @@
 		      (frame *current-child*))))
     (when frame-dest
       (dolist (child *child-selection*)
-	(pushnew child (frame-child frame-dest)))
+	(unless (find-child-in-parent child frame-dest)
+	  (pushnew child (frame-child frame-dest))))
       (show-all-children))))
 
 (defun paste-selection ()



More information about the clfswm-cvs mailing list