Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uunet!ora!bloom-beacon!dont-send-mail-to-path-lines From: twl@cadreri.UUCP (Todd W. Lainhart) Newsgroups: comp.windows.x Subject: Window Manager Hints Message-ID: <9103141417.AA10649@sun.Eng.Sun.COM> Date: 14 Mar 91 13:48:56 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 53 Hello xperts - I have some questions regarding window manager hints in general. It's my hope that I can clear up a bug in my application. Here's the problem: I have an application running under OpenWindows 2.0. From time to time (and I don't know how to duplicate this condition) my application "loses" its icon pixmap, and no longer appears to be receiving keypress events. Of course, this stuff is setup in a window hints data structure similar to the following: wmhints.flags = InputHint; wmhints.input = True; wmhints.icon_pixmap = XCreatePixmapFromBitmapData(...); wmhints.flags |= IconPixmapHint; Now, Chapter 10 of O'Reilly Vol 1, on page 303 states the following: "The window manager is encouraged to honor as many of the hints as possible, but it is not required to honor any of them. Therefore, the application must not depend on its hints being honored; it must be capable of operating when any of its hints are ignored or denied." It looks like my hints are being ignored for mysterious reasons. So if that's the case, how do I best handle setting the input focus? It seems somewhat kludgy to set the input focus when my X window (I have only one) gets an EnterNotify event, and then to release the input focus to the root window when I get a LeaveNotify, but that's just what the code I'm looking at now does - I think a more elegant solution is required. BTW, I did notice a potential bug in my application - it appears that these properties are being set *after* the window has been mapped. O'Reilly, and other code that I've seen, set the properties *before* the window has been mapped. This could be a problem... I guess I could generalize the question and ask, "If there's no window manager, how does one best set/relieve input focus for applications". Also, I'm assuming that the input model for an application that consists of a single X window (but has its own model within the window of graphic object selection and navigation) would be one of "Passive Input" - in other words, the application has the input focus when the window manager tells it to. It appears that if I use the Passive Input model, I don't need to be concerned with WM_TAKE_FOCUS messages from the window manager. Also, another question: I notice that O'Reilly also suggests using XSetWMProperties(...) over XSetWMHints(...) (although I can find no man pages on the former call). Is the distinction important, or are the calls just wrappers over more primitive calls? I've looked through my copy of FAQ (I don't know how old it is...), and I don't see anything related to this. Thanks for your consideration. -- Todd