Path: utzoo!yunexus!hydroesm!jtsv16!torsqnt!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!snorkelwacker!bloom-beacon!eng.sun.COM!smarks From: smarks@eng.sun.COM (Stu t Marks) Newsgroups: comp.windows.x Subject: Re: xnews problems with input Message-ID: <9005292320.AA10101@trantor.Eng.Sun.COM> Date: 29 May 90 23:20:55 GMT Article-I.D.: trantor.9005292320.AA10101 References: <1990May24.055211.19052@cs.uoregon.edu> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 42 | The department here runs 'xnews' (version 1.0.1) on the SparcStations | that we have here. The problem is that when I take the code that I | wrote for X11R3 to xnews it doesn't recieve input from the keyboard. | | As an experiment, I called XSetInputFocus() and received input | for as long as the pointer remained in the window. (before the &@$* | window manager took control again). | | Anyway how has Sun muddled things up, and what do I have to do | to recieve input from the keyboard? Sorry, this isn't because of any "muddling up" by Sun. I suspect that your program isn't supplying the proper "hints" that will allow it to receive the input focus. These hints are defined by the ICCCM (an X Consortium Standard), and the window manager in xnews (really, OpenWindows) will only assign the focus to a window if it has supplied the proper hints. Here's a code fragment that you can patch into your program so that it will create the proper input focus hint. #include #include ... Display *dpy; Window win; XWMHints wmhints; ... dpy = XOpenDisplay(...); ... win = XCreateSimpleWindow(...); ... wmhints.flags = InputHint; wmhints.input = True; XSetWMHints(dpy, win, &wmhints); XMapWindow(dpy, win); s'marks Stuart W. Marks ARPA: smarks@eng.sun.com Window Systems Group UUCP: sun!smarks Sun Microsystems, Inc.