from John Ousterhout, ouster@cs.Berkeley.EDU):
Each or event has a "detail" field, which you can access
from bindings with "%d". If the detail is "NotifyInferior" it means the
pointer has moved into or out of a child window (so it`s really still in
the area of the window receiving the event). You should be able to check
the detail in your scripts and ignore events with a detail of NotifyInferior.
Check the Xlib documentation for Enter/Leave events for complete
information on the detail field.