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

pbrochard at common-lisp.net pbrochard at common-lisp.net
Fri Jun 6 21:43:35 UTC 2008


Author: pbrochard
Date: Fri Jun  6 17:43:34 2008
New Revision: 146

Modified:
   clfswm/ChangeLog
   clfswm/src/clfswm-internal.lisp
   clfswm/src/clfswm-layout.lisp
Log:
show-all-children: Always raise all displayed children. Remove all references to raise-p.

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Fri Jun  6 17:43:34 2008
@@ -1,3 +1,8 @@
+2008-06-06  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* src/clfswm-internal.lisp (show-all-children): Always raise all
+	displayed children. Remove all references to raise-p.
+
 2008-06-04  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* src/menu-def.lisp (child-menu): New menu entry on raise/lower

Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp	(original)
+++ clfswm/src/clfswm-internal.lisp	Fri Jun  6 17:43:34 2008
@@ -419,24 +419,24 @@
 
 (defmethod adapt-child-to-parent ((window xlib:window) parent)
   (with-xlib-protect
-    (if (managed-window-p window parent)
-	(multiple-value-bind (nx ny nw nh raise-p)
-	    (get-parent-layout window parent)
-	  (setf nw (max nw 1)  nh (max nh 1))
-	  (let ((change (or (/= (xlib:drawable-x window) nx)
-			    (/= (xlib:drawable-y window) ny)
-			    (/= (xlib:drawable-width window) nw)
-			    (/= (xlib:drawable-height window) nh))))
-	    (setf (xlib:drawable-x window) nx
-		  (xlib:drawable-y window) ny
-		  (xlib:drawable-width window) nw
-		  (xlib:drawable-height window) nh)
-	    (values raise-p change)))
-	(values nil nil))))
+    (when (managed-window-p window parent)
+      (multiple-value-bind (nx ny nw nh)
+	  (get-parent-layout window parent)
+	(setf nw (max nw 1)  nh (max nh 1))
+	(let ((change (or (/= (xlib:drawable-x window) nx)
+			  (/= (xlib:drawable-y window) ny)
+			  (/= (xlib:drawable-width window) nw)
+			  (/= (xlib:drawable-height window) nh))))
+	  (setf (xlib:drawable-x window) nx
+		(xlib:drawable-y window) ny
+		(xlib:drawable-width window) nw
+		(xlib:drawable-height window) nh)
+	  change)))))
+
 
 (defmethod adapt-child-to-parent ((frame frame) parent)
   (with-xlib-protect
-    (multiple-value-bind (nx ny nw nh raise-p)
+    (multiple-value-bind (nx ny nw nh)
 	(get-parent-layout frame parent)
       (with-slots (rx ry rw rh window) frame
 	(setf rx nx  ry ny
@@ -450,23 +450,18 @@
 		(xlib:drawable-y window) ry
 		(xlib:drawable-width window) rw
 		(xlib:drawable-height window) rh)
-	  (values raise-p change))))))
+	  change)))))
 
 (defmethod adapt-child-to-parent (child parent)
   (declare (ignore child parent))
-  (values nil nil))
-
+  nil)
 
 
 
-(defun raise-if-needed (window raise-p selected-p)
-  (when (or (eql raise-p t)
-	    (and (eql raise-p :first-only) selected-p))
-    (raise-window window)))
 
-(defgeneric show-child (child parent display-p raise-p selected-p))
+(defgeneric show-child (child parent display-p))
 
-(defmethod show-child ((frame frame) parent display-p raise-p selected-p)
+(defmethod show-child ((frame frame) parent display-p)
   (declare (ignore parent))
   (with-xlib-protect
     (with-slots (window show-window-p) frame
@@ -475,22 +470,22 @@
 	    (when (or *show-root-frame-p* (not (equal frame *current-root*)))
 	      (setf (xlib:window-background window) (get-color "Black"))
 	      (xlib:map-window window)
-	      (raise-if-needed window raise-p selected-p)))
+	      (raise-window window)))
 	  (hide-window window)))
     (display-frame-info frame)))
 
 
-(defmethod show-child ((window xlib:window) parent display-p raise-p selected-p)
+(defmethod show-child ((window xlib:window) parent display-p)
   (with-xlib-protect
     (if (or (managed-window-p window parent)
 	    (equal parent *current-child*))
 	(when display-p
 	  (xlib:map-window window)
-	  (raise-if-needed window raise-p selected-p))
+	  (raise-window window))
 	(hide-window window))))
 
-(defmethod show-child (child parent display-p raise-p selected-p)
-  (declare (ignore child parent display-p raise-p selected-p))
+(defmethod show-child (child parent display-p)
+  (declare (ignore child parent display-p))
   ())
 
 
@@ -558,10 +553,9 @@
 only for display-child and its children"
   (let ((geometry-change nil))
     (labels ((rec (root parent selected-p selected-parent-p display-p)
-	       (multiple-value-bind (raise-p change)
-		   (adapt-child-to-parent root parent)
-		 (when change (setf geometry-change change))
-		 (show-child root parent display-p raise-p selected-p))
+	       (when (adapt-child-to-parent root parent)
+		 (setf geometry-change t))
+	       (show-child root parent display-p)
 	       (select-child root (if (equal root *current-child*) t
 				      (if (and selected-p selected-parent-p) :maybe nil)))
 	       (when (frame-p root)
@@ -705,11 +699,11 @@
 
 (defun select-next-child ()
   "Select the next child"
-  (select-next/previous-child #'anti-rotate-list))
+  (select-next/previous-child #'rotate-list))
 
 (defun select-previous-child ()
   "Select the previous child"
-  (select-next/previous-child #'rotate-list))
+  (select-next/previous-child #'anti-rotate-list))
 
 
 

Modified: clfswm/src/clfswm-layout.lisp
==============================================================================
--- clfswm/src/clfswm-layout.lisp	(original)
+++ clfswm/src/clfswm-layout.lisp	Fri Jun  6 17:43:34 2008
@@ -30,10 +30,9 @@
 ;;;
 ;;; To add a new layout:
 ;;;   1- define your own layout: a method returning the real size of the
-;;;      child in screen size (integer) as 5 values (rx, ry, rw, rh, raise-p).
+;;;      child in screen size (integer) as 5 values (rx, ry, rw, rh).
 ;;;      This method can use the float size of the child (x, y ,w , h).
 ;;;      It can be specialised for xlib:window or frame
-;;;      Raise-p is nil or :first-only or t
 ;;;   2- Define a seter function for your layout
 ;;;   3- Register your new layout with register-layout.
 
@@ -101,15 +100,13 @@
     (values (1+ rx)
 	    (1+ ry)
 	    (- rw 2)
-	    (- rh 2)
-	    :first-only)))
+	    (- rh 2))))
 
 (defmethod no-layout ((child frame) parent)
   (values (x-fl->px (frame-x child) parent)
 	  (y-fl->px (frame-y child) parent)
 	  (w-fl->px (frame-w child) parent)
-	  (h-fl->px (frame-h child) parent)
-	  t))
+	  (h-fl->px (frame-h child) parent)))
 
 
 
@@ -136,8 +133,7 @@
     (values (round (+ (frame-rx parent) (truncate (* (mod pos n) dx)) 1))
 	    (round (+ (frame-ry parent) (truncate (* (truncate (/ pos n)) dy)) 1))
 	    (round (- dx 2))
-	    (round (- dy 2))
-	    t)))
+	    (round (- dy 2)))))
 
 (defun set-tile-layout ()
   "Tile child in its frame"
@@ -162,13 +158,11 @@
 	      (values (1+ rx)
 		      (1+ ry)
 		      (- (round (* rw size)) 2)
-		      (- rh 2)
-		      t)
+		      (- rh 2))
 	      (values (1+ (round (+ rx (* rw size))))
 		      (1+ (round (+ ry (* dy (1- pos)))))
 		      (- (round (* rw (- 1 size))) 2)
-		      (- (round dy) 2)
-		      t))
+		      (- (round dy) 2)))
 	  (no-layout child parent)))))
 
 
@@ -197,13 +191,11 @@
 	      (values (1+ (round (+ rx (* rw (- 1 size)))))
 		      (1+ ry)
 		      (- (round (* rw size)) 2)
-		      (- rh 2)
-		      t)
+		      (- rh 2))
 	      (values (1+ rx)
 		      (1+ (round (+ ry (* dy (1- pos)))))
 		      (- (round (* rw (- 1 size))) 2)
-		      (- (round dy) 2)
-		      t))
+		      (- (round dy) 2)))
 	  (no-layout child parent)))))
 
 
@@ -234,13 +226,11 @@
 	      (values (1+ rx)
 		      (1+ ry)
 		      (- rw 2)
-		      (- (round (* rh size)) 2)
-		      t)
+		      (- (round (* rh size)) 2))
 	      (values (1+ (round (+ rx (* dx (1- pos)))))
 		      (1+ (round (+ ry (* rh size))))
 		      (- (round dx) 2)
-		      (- (round (* rh (- 1 size))) 2)
-		      t))
+		      (- (round (* rh (- 1 size))) 2)))
 	  (no-layout child parent)))))
 
 
@@ -269,13 +259,11 @@
 	      (values (1+ rx)
 		      (1+ (round (+ ry (* rh (- 1 size)))))
 		      (- rw 2)
-		      (- (round (* rh size)) 2)
-		      t)
+		      (- (round (* rh size)) 2))
 	      (values (1+ (round (+ rx (* dx (1- pos)))))
 		      (1+ ry)
 		      (- (round dx) 2)
-		      (- (round (* rh (- 1 size))) 2)
-		      t))
+		      (- (round (* rh (- 1 size))) 2)))
 	  (no-layout child parent)))))
 
 
@@ -309,8 +297,7 @@
       (values (round (+ rx (truncate (* (mod pos n) dx)) (* dx size) 1))
 	      (round (+ ry (truncate (* (truncate (/ pos n)) dy)) (* dy size) 1))
 	      (round (- dx (* dx size 2) 2))
-	      (round (- dy (* dy size 2) 2))
-	      t))))
+	      (round (- dy (* dy size 2) 2))))))
 
 (defun set-tile-space-layout ()
   "Tile Space: tile child in its frame leaving spaces between them"
@@ -350,20 +337,17 @@
 	      (values (+ rx space 1)
 		      (1+ ry)
 		      (- (round (* rw size)) 2 space)
-		      (- rh 2)
-		      t)
+		      (- rh 2))
 	      (values (1+ (round (+ rx (* rw size))))
 		      (1+ (round (+ ry (* dy (1- pos)))))
 		      (- (round (* rw (- 1 size))) 2)
-		      (- (round dy) 2)
-		      t))
+		      (- (round dy) 2)))
 	  (multiple-value-bind (rnx rny rnw rnh)
 	      (no-layout child parent)
 	    (values (+ rnx space)
 		    rny
 		    (- rnw space)
-		    rnh
-		    t))))))
+		    rnh))))))
 
 
 (defun set-tile-left-space-layout ()



More information about the clfswm-cvs mailing list