Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!agate!ucbvax!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU Newsgroups: comp.windows.x Subject: Re: ICCCM question on InputFocus Message-ID: <9012190749.AA03861@Larry.McRCIM.McGill.EDU> Date: 19 Dec 90 07:49:52 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 47 > I have an application with multiple documents, and I need some way of > determining which document is "current". Users make documents > current by clicking on them on the Mac. The X equivalent seems to be > FocusIn events, Depending on precisely what you want, the equivalent is either ButtonPress or FocusIn. If you want to choose among multiple top-level windows, I would recommend FocusIn. > but under my current configuration of twm, I get these events > whenever the cursor passes over a window. I know I can configure twm > to set focus only when the user clicks, but other users may have > their window managers set to give focus to windows when the cursor > passes into them. Yes. I'm glad to see you're considering other configurations than the one you use. (No smiley; I'm serious. I've seen too many programs that break in one way or another when run under unconventional setups; the commonest problem is programs that ignore typein when the mouse isn't in their window, even if they've been given focus by the wm. If these had been tested by anyone but the developer(s)...grumble.) > I can't find anywhere in the ICCCM spec that dictates when a window > manager should give focus to a window. This is as it should be. Different window managers have different policies, and it is not the ICCCM's place to dictate which ones are or aren't acceptable (if it tried, it would be ignored instead of accepted...). > If I can't differentiate between the user clicking on the title bar > of the window and the cursor passing through the window, I can't see > how to use focus events to indicate "current". I don't see why not - if the focus is due to a transient passage over the window, you will get a FocusOut shortly, indicating that the window in question is no longer "current". If you get a FocusIn on some other one of your windows, then that one becomes current; if not, then it doesn't matter because you aren't going to get keystrokes anyway. Or so it seems to me...but I don't know all the details of your app. Is this not workable for some reason? der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu