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

Philippe Brochard pbrochard at common-lisp.net
Sun Mar 6 20:18:10 UTC 2011


Author: pbrochard
Date: Sun Mar  6 15:18:10 2011
New Revision: 422

Log:
(show-all-children): add the ability to display all child from *root-frame* and hide all those who are not in *current-root*. -> remove hide-all-children when needed.

Modified:
   clfswm/ChangeLog
   clfswm/src/clfswm-circulate-mode.lisp
   clfswm/src/clfswm-expose-mode.lisp
   clfswm/src/clfswm-internal.lisp
   clfswm/src/package.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Sun Mar  6 15:18:10 2011
@@ -2,6 +2,11 @@
 
 	* src/clfswm-internal.lisp (show-all-children): Simplify the
 	selection method.
+	(show-child): Display an unmanaged window whe  it's the current
+	child.
+	(show-all-children): add the ability to display all child from
+	*root-frame* and hide all those who are not in *current-root*.
+	-> remove hide-all-children when needed.
 
 	* src/xlib-util.lisp (move-window,resize-window): Add a
 	*color-move-window* border when moving or resizing a window.

Modified: clfswm/src/clfswm-circulate-mode.lisp
==============================================================================
--- clfswm/src/clfswm-circulate-mode.lisp	(original)
+++ clfswm/src/clfswm-circulate-mode.lisp	Sun Mar  6 15:18:10 2011
@@ -85,9 +85,7 @@
   (no-focus)
   (let ((frame-is-root? (and (child-equal-p *current-root* *current-child*)
 			     (not (child-equal-p *current-root* *root-frame*)))))
-    (if frame-is-root?
-	(hide-all *current-root*)
-	(select-current-frame nil))
+    (select-current-frame nil)
     (unless (and *circulate-orig* *circulate-parent*)
       (reset-circulate-brother))
     (let ((len (length *circulate-orig*)))
@@ -98,7 +96,7 @@
 		  *current-child* (frame-selected-child *circulate-parent*))))
 	(when frame-is-root?
 	  (setf *current-root* *current-child*))))
-    (show-all-children)
+    (show-all-children t)
     (draw-circulate-mode-window)))
 
 (defun reorder-subchild (direction)

Modified: clfswm/src/clfswm-expose-mode.lisp
==============================================================================
--- clfswm/src/clfswm-expose-mode.lisp	(original)
+++ clfswm/src/clfswm-expose-mode.lisp	Sun Mar  6 15:18:10 2011
@@ -167,7 +167,6 @@
     (if (generic-mode 'expose-mode 'exit-expose-loop
 		      :original-mode '(main-mode))
 	(multiple-value-bind (x y) (xlib:query-pointer *root*)
-	  (dbg *expose-selected-child* (child-fullname *expose-selected-child*))
 	  (let* ((child (or *expose-selected-child* (find-child-under-mouse x y)))
 		 (parent (find-parent-frame child *root-frame*)))
 	    (when (and child parent)

Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp	(original)
+++ clfswm/src/clfswm-internal.lisp	Sun Mar  6 15:18:10 2011
@@ -644,6 +644,7 @@
 
 (defmethod show-child ((window xlib:window) parent previous)
   (if (or (managed-window-p window parent)
+	  (child-equal-p window *current-child*)
 	  (not (hide-unmanaged-window-p parent))
 	  (child-equal-p parent *current-child*))
       (progn
@@ -730,23 +731,31 @@
 
 
 
-(defun show-all-children ()
-  "Show all children from *current-root*."
+(defun show-all-children (&optional (from-root-from nil))
+  "Show all children from *current-root*. When from-root-from is true
+Display all children from root frame and hide those not in *current-root*"
   (let ((geometry-change nil)
 	(previous nil))
-    (labels ((rec (child parent selected-p)
-	       (when (adapt-child-to-parent child parent)
-		 (setf geometry-change t))
-	       (select-child child (cond ((child-equal-p child *current-child*) t)
-					 (selected-p :maybe)
-					 (t nil)))
-	       (when (frame-p child)
-		 (let ((selected-child (frame-selected-child child)))
-		   (dolist (sub-child (frame-child child))
-		     (rec sub-child child (and selected-p (child-equal-p sub-child selected-child))))))
-	       (show-child child parent previous)
-	       (setf previous child)))
-      (rec *current-root* nil t)
+    (labels ((rec (child parent selected-p in-current-root)
+	       (let ((child-current-root-p (child-equal-p child *current-root*)))
+		 (when (or in-current-root child-current-root-p)
+		   (when (adapt-child-to-parent child (if child-current-root-p nil parent))
+		     (setf geometry-change t))
+		   (select-child child (cond ((child-equal-p child *current-child*) t)
+					     (selected-p :maybe)
+					     (t nil))))
+		 (when (frame-p child)
+		   (let ((selected-child (frame-selected-child child)))
+		     (dolist (sub-child (frame-child child))
+		       (rec sub-child child
+			    (and selected-p (child-equal-p sub-child selected-child))
+			    (or in-current-root child-current-root-p)))))
+		 (if (or in-current-root child-current-root-p)
+		     (show-child child parent previous)
+		     (hide-child child))
+		 (setf previous child))))
+      (rec (if from-root-from *root-frame* *current-root*)
+	   nil t (child-equal-p *current-root* *root-frame*))
       (set-focus-to-current-child)
       geometry-change)))
 
@@ -926,7 +935,6 @@
 
 (defun toggle-show-root-frame ()
   "Show/Hide the root frame"
-  (hide-all *current-root*)
   (setf *show-root-frame-p* (not *show-root-frame-p*))
   (show-all-children))
 

Modified: clfswm/src/package.lisp
==============================================================================
--- clfswm/src/package.lisp	(original)
+++ clfswm/src/package.lisp	Sun Mar  6 15:18:10 2011
@@ -71,7 +71,7 @@
 (defparameter *default-font-string* "fixed"
   "Config(): The default font used in clfswm")
 
-(defparameter *color-move-window* "Green"
+(defparameter *color-move-window* "DeepPink"
   "Config(Main mode group): Color when moving or resizing a windows")
 
 (defparameter *child-selection* nil)




More information about the clfswm-cvs mailing list