home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!centerline!noc.near.net!gateway!miki!oj
- From: oj@miki.pictel.com (Oliver Jones)
- Subject: Re: Focus event weirdness
- Message-ID: <1992Aug19.213435.1329@miki.pictel.com>
- Keywords: detail
- Organization: PictureTel Corporation
- References: <BRENNAN.92Aug18164915@yosemite.hal.com>
- Date: Wed, 19 Aug 1992 21:34:35 GMT
- Lines: 62
-
- In article <BRENNAN.92Aug18164915@yosemite.hal.com> brennan@hal.com (Dave Brennan) writes:
- >Whilst writing a widget I noticed that in some cases when I move the
- >pointer into my window (using a WM with focus follows pointer) some
- >times I get one FocusIn event, and other times I get FocusOut events
- >followed by FocusIn events (one each for the toplevel window and
- >widget window).
-
- >Can anyone tell me what's going on here?
-
- Yes, you have to look at the detail member of the Focus{In|Out} events
- to figure this out.
-
- > ..............EVENT: FocusOut
- > detail: Pointer
- > sequence number: 0ec4
- > event: WIN 04800014
- > mode: Normal
-
- This event gets delivered to your widget. It's telling your
- widget that it is a pointer-containing inferior of the window which
- is actually losing the focus.
-
- > ..............EVENT: FocusOut
- > detail: Pointer
- > sequence number: 0ec4
- > event: WIN 04800013
- > mode: Normal
-
- This event gets delivered to your toplevel. ditto.
-
- The window actually losing the focus is the WM's wrapper, I guess.
-
- > ..............EVENT: FocusIn
- > detail: Nonlinear
- > sequence number: 0ec4
- > event: WIN 04800013
- > mode: Normal
- This event gets delivered to your toplevel. This one tells your toplevel
- that it has actually received the focus.
-
- > ..............EVENT: FocusIn
- > detail: Pointer
- > sequence number: 0ec4
- > event: WIN 04800014
- > mode: Normal
-
- This event gets delivered to your widget, and tells it that one of its
- ancestor windows received the focus WHILE the pointer was inside your
- widget's window. You're in a race with something ... probably the
- window manager ... to see whether the pointer or the focus can get there
- first.
-
- If your widget is monitoring whether it's going to receive KeyPress
- events or not (that is, if you're highlighting a data-entry field
- or something similar), you need also to monitor EnterNotify and
- LeaveNotify events.
-
- I don't usually do book plugs on usenet, but in this case I suggest
- you borrow a copy of Introduction to the X Window System
- (Prentice-Hall) from your local library and look at pp378 - 384.
-
- Oliver Jones
-