A small fix for smart placement



Dear Sawfish Users,

I have added a small fix to the "smart placement" algorithm, specifically first-fit.

Specifically, at work I have two monitors, the left has a height of 1200 and the right of 1024. The placement algorithm would sometimes put windows with their bottoms aligned on 1200 on the right screen, meaning I couldn't actually see part of them. So after figuring out what the problem is, I added an extra check for it.

I'm still hoping to write a more robust placement algorithm (being able to use configurable smart placement is one of my top reasons for using sawfish), but I have very little lisp experience. So, for a first step, this will do. I hope someone finds it useful.

Also, I would like to ask, what is the official stance on how wide a tab is in sawfish sources? When I set it to 2, it doesn't look right, but also at 3 and 4, as some lines have spaces, some lines tabs, some have both. For debugging I just told the editor to re-indent everything as it feels like (vim), but for submission I'd like to comply with policy.

Sincerely,

Rafal Kolanski.

--- wm/placement/smart.jl	2009-06-26 22:01:29.000000000 +1000
+++ /home/rafalk/smart.jl	2010-04-10 23:26:42.000000000 +1000
@@ -148,7 +148,10 @@
 			   (<= (+ (car point-foo) (car dims)) (screen-width))
 			   (<= (+ (cdr point-foo) (cdr dims)) (screen-height))
 			   (= (rectangle-heads
-			       (rectangle-from-coords point-foo dims)) 1))
+			       (rectangle-from-coords point-foo dims)) 1)
+			   ; don't let bottom of window exceed head smaller than screen
+			   (<= (+ (cdr point-foo) (cdr dims))
+				   (cdr (head-dimensions (find-head (car point-foo) (cdr point-foo))))))
 		  (setq tem (rect-total-overlap dims point-foo rects))
 		  (when (or (not min-point) (< tem min-overlap))
 		    (setq min-overlap tem)


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