Are only 3 heads supported in grow/pack?

Hi. The 1.6.0 news says that the grow / pack module supports only
three heads, but I doubt it. Though I don't understand Xinerama at
all, a quick glance doesn't give me any impression that it's only
three.  The commit diff is attached at the bottom of this message.

It's Janek who said it, but he has only 3 heads, and he doesn't
understand lisp. So it is confirmed that it works for 3. If 3 is ok,
why not 4? I guess it's his mistake, and shouldn't creep into the
news. (Sorry I haven't argued on this.)

Teika (Teika kazura)

commit fcca4ea346d6577c3fda66192cf73e089f17bfca
Author: Christopher Roy Bratusek <chris nanolx org>
Date:   Sat Nov 14 15:33:36 2009 +0100

    basic support for xinerama in Grow/Pack

diff --git a/lisp/sawfish/wm/commands/grow-pack.jl b/lisp/sawfish/wm/commands/grow-pack.jl
index 879fc61..f5399c9 100644
--- a/lisp/sawfish/wm/commands/grow-pack.jl
+++ b/lisp/sawfish/wm/commands/grow-pack.jl
@@ -159,10 +159,28 @@ See `pack-window-up'."
   ;; Implementation part.
+  (define (bump-get-head w direction)
+    (let* ((frame-dims (window-frame-dimensions w))
+           (frame-pos (window-position w))
+           (head1 (current-head w))
+           (head2 (find-head
+                   (case direction
+                     ((left) (- (car frame-pos) 1))
+                     ((right) (+ (car frame-pos) (car frame-dims)))
+                     (t (car frame-pos)))
+                   (case direction
+                     ((up) (- (cdr frame-pos) 1))
+                     ((down) (+ (cdr frame-pos) (cdr frame-dims)))
+                     (t (cdr frame-pos))))))
+      (if head2 head2 head1)))
   (define (bump-distance w direction maximize min-dist)
     (let* ((a (window-position w))
 	   (z (window-frame-dimensions w))
 	   (depth (window-get w 'depth))
+	   (head (bump-get-head w direction))
+	   (head-dims (head-dimensions head))
+	   (head-offs (head-offset head))
 	   bump cmp
 	   xa xz
 	   min-next border xborders)
@@ -175,7 +193,9 @@ See `pack-window-up'."
 					,(y xa) . ,(+ (y xa) (y xz))))
 		  a (y a)
 		  z (+ a (y z))
-		  bump 0
+	          bump (if (eq direction 'up)
+	                   (cdr head-offs)
+	                   (car head-offs))
 		  cmp <=)
 	  (setq border (+ (x a) (x z))
 		min-next (+ border min-dist)
@@ -183,7 +203,9 @@ See `pack-window-up'."
 				      ,(y xa) . ,(+ (y xa) (y xz))))
 		a (y a)
 		z (+ a (y z))
-		bump ((if (eq direction 'down) screen-height screen-width))
+	        bump (if (eq direction 'down)
+	                 (+ (cdr head-offs) (cdr head-dims))
+	                 (+ (car head-offs) (car head-dims)))
 		cmp >=)))
       (if (cmp bump min-next)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]