If I remember right there is a tool that comes with X, that will give you that information, but for the life of me I can not remember what that tool is called. It is used for differnt type things, but mostly it gives information about where the mouse is, what window it is over etc... Could you be refering to xev?