head and window



It's head issue. Jeremy revealed it last October, and I develop it
further here.

First of all, both Xinerama and RandR support multi-heads. RandR
replaces Xinerama, but here only lisp part is related, so it doesn't
matter much which.

RandR spec is:
http://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt

This article on RandR in phoronix may help:
http://www.phoronix.com/scan.php?page=article&item=927&num=1


It's that (current-head w) returns wrong value when w is outside of
the current viewport. He guessed (find-head) in C behaved wrongly,
but not. (find-head x y) is correct, by returning nil when the point
lies outside of the screen (when Xinerama is present, it's all screens
combined.)

The culprit is current-head in wm/misc.jl. You can see that the 'and'
clause fails after nil return value from (find-head).

I'm not sure of the correct solution, but let me point out some:

* 'pointer-head' is already there. So the name 'current-head' sounds
  something redundant. Maybe the wanted function is 'window-head', or
  '-heads'.
* 'current-head', and its derivativs
  'current-head-{dimensions,offset}' seem to be usually expected to
  return the head, rather than nil. Currently it returns the head
  containing the center of the window, so a window which is only
  partially visible, or which spans across multiple heads are treated
  wrongly. And the precise definition of the function is not
  documented. Anyway, what's needed should be met.
* Since current-head is incomplete, the functions which call it may be
  so, too. (grow-pack may fail with 3 or even with 2 heads. :/)

Hm, I first thought fixing the bug in current-head is sufficient,
but not so easy. I've never read rect thingy.

I haven't studied much about Xinerama and RandR yet, but the bug
report by Janek (read another post of today made by me) made me feel
that it's necessary to raise this topic.

Regards,
Teika (Teika kazura)



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