Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ora!bloom-beacon!dont-send-mail-to-path-lines From: dshr@eng.sun.COM (David Rosenthal) Newsgroups: comp.windows.x Subject: Re: running while iconized Message-ID: <9103162045.AA13908@devnull.Eng.Sun.COM> Date: 16 Mar 91 20:33:46 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 32 > Now, if you're asking how to get button events, key presses, etc. when > you're application is iconified, you can get the window ID of the icon > window and select for input on that window like any other window. > > Whether or not this is a good idea remains an open question. > The ICCCM Section 4.1.9 (page 530 of the Digital Press 2nd Edition) says: 8. Clients must not depend on being able to receive input events by means of their icon windows. ..... Window managers will differ as to whether they support input events to client's icon windows; most will allow the client to receive some subset of the keys and buttons. What this means is that it is OK to have your client do the appropriate this *if* it receives a keystoke or button press via its icon window, and thus that it is perfectly OK to select for these events on the icon window, but it must not be essential to the operation of the client that it receive such an event. Note that events may arrive via the icon window at any time. It is not a good assumption that the icon window is unmapped when the top-level window is mapped. For eample, some window management styles have an icon permanently visible irrespective of whether the main window is visible or not. Other styles will never make the icon window visible. So defensive programming is in order - do not *depend* on the icon doing anything at all, but do make it do the right thing if it is visible, and if it gets events, and so on. David.