[comp.sys.sun] mouse in window via notifier?

phill%med-image.compsci.bristol.ac.uk@nss.cs.ucl.ac.uk (04/23/89)

I am writing a program where I have to know whether the mouse is in the
current window or elsewhere on the desk top at all times.

I've tried interposing an event handler and setting a flag based on
occurances of LOC_WINENTER and LOC_WINEXIT, but that doesn't catch all
cases. For example, if you move across a thin frame border onto a canvas
very often no LOC_WINENTER is generated.

I then tried having an event procedure for each of the top level portions
of my program - panels, canvases etc. In each of these I check for
LOC_RGNENTER, LOC_RGNEXIT, LOC_WINENTER and LOC_WINEXIT.  Intelligent
setting of a flag when these events occur works pretty well, but I'm not
convinced it's foolproof.

Does anyone know of a better, if possible foolproof, way?

I will email a summary to the list if desired.

Phillip Everson
Medical Imaging
Dept Comp Sci
University of Bristol, UK
<everson@cs.bris.ac.uk>