Path: utzoo!mnetor!uunet!husc6!think!ames!ucbcad!ucbvax!hplabs!hpcea!hpfcdc!hpfclp!diamant
From: diamant@hpfclp.HP.COM (John Diamant)
Newsgroups: comp.windows.x
Subject: Re: hacking on uwm (V11)
Message-ID: <9740007@hpfclp.HP.COM>
Date: 6 Dec 87 20:30:02 GMT
References: <6037@jade.BERKELEY.EDU>
Organization: HP, Fort Collins, CO
Lines: 32

> > EnterNotify is the way to go.
> 
> this seems like it can't be right.  It would make it impossible to correctly
> implement a click listener model rather than the tracked one (one where
> you have to perform an action to force input to move to a new window).
> 
> Maybe some combination of EnterNotify and FocusIn would do the trick, but
> EnterNotify by itself won't do it.

Jordan pointed out to me (in a private letter) that there was a focus flag
in the event structures for Enter and Leave events.  It appears that using
this flag will resolve my concern about handling non-tracked listeners.
That flag tells you whether the input focus is in the window generating that
event.

I think the correct way to handle this would be to monitor all Enter and Leave
events, but to take action only on the value of the focus flag (don't care
whether this was an Enter or a Leave -- what matters is where the input
focus went).  Likewise, you still need to watch for FocusIn/FocusOut
events since in a non-tracked listener, the Focus will not come with a window
entry.  As I understand it, there will be no FocusIn or FocusOut events in
a tracked listener, which is fine if you are monitoring the focus flag on the
Enter and Leave events.

I would like to make a plea to all X11 application writers not to forget about
the non-tracked listener and pay attention to the focus in the way I've
described (unless of course my logic is wrong, in which case application
programmers should do it right!).

John Diamant 				 UUCP: {hplabs,hpfcla}!hpfclp!diamant
Hewlett Packard Co.		ARPA Internet: diamant%hpfclp@hplabs.HP.COM
Fort Collins, CO