Re: Window placement and calculate-workarea

rafalk cse unsw edu au (2008-09-12 at 2159.19 +1000):
> Hello again,
> Looking at how first-fit placement works (and top-left too), they seem  
> to call (calculate-workarea #:window w) for the window being created.

The "calculate-workarea" I see in top-left has "#:head (current-head)"
too, not just "#:window".

> Inside calculate-workarea, I see this:
>     (unless head
>       (setq head (current-head window)))
> However, on my system, (current-head window) for a freshly created  
> window always returns head 0 ... it doesn't make sense to me why one  
> would want that anyway. I'd want to get the head that currently has  
> input focus, or even the mouse cursor.
> Does anyone know why this is the way it is?

It makes sure "head" has something assigned if it was not provided
before via the keyed parameter. So you go up the code looking for
calls to "calculate-workarea" and see that in placement.jl and
top-left.jl it gets passed "current-head", so the "setq" is not
used. You keep on greping you see "head" probably means "pointer-head"
as per misc.jl.

Now, my time for doubts, what does "(w (input-focus))" means as in
"(define (current-head #!optional (w (input-focus)))..."? Some kind of
fallback so if no passed window then the one with input focus gets

Btw, ack (a special grep, Debian name is ack-grep to avoid collision
with other ack) becomes pretty useful for all this up and down the
ropes: ack-grep --type-add scheme=.jl -- "whatever"


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