[comp.windows.news] xnews and X -- input focus problem

news@bellcore.bellcore.com (news) (11/16/89)

Apologies if this has been answered before, but...

I'm using "OpenWindows(tm) 1.0".

I'm prevented from running xnews full-time by the following problem: I
can't get keyboard information to some Xt applications.    The two
applications both respond fine to mouse input, but this is not
sufficient.  One of them is the "xdvi" program -- if that helps.  The
applications and the server are running on the same Sun-4 running
4.0.3c. Both applications use the Athena Widget set.

The keyboard input gets sent to the window the X application was
started from, by the way.  

Thanks for any suggestions....



					Nat Howard
					nrh@bellcore.com

montnaro@sprite.crd.ge.com (Skip Montanaro) (11/17/89)

The incompatibility between X/NeWS (with its ICCCM-compliant window manager
and toolkit) and older X applications is getting rather well-known these
days. Another person here at GE CRD just posted a note about this problem to
comp.windows.x. I've reproduced it below. Placing "*Input: true" in
.Xdefaults worked for me, at least it cured xdvi's problems. I haven't had
the opportunity to try other applications yet. Apparently Phil tried xfig,
xdbx, and xman, however.


  From shaffer@athena.crd.ge.com Wed Nov 15 17:13:12 1989
  Newsgroups: comp.windows.x
  Reply-To: shaffer@crd.ge.com (Phillip L. Shaffer)
  Organization: General Electric Corp. R&D, Schenectady, NY
  From: shaffer@athena.crd.ge.com
  Subject: Re: Has anyone fixed xfig and xdbx to work with Open Windows?
  Date: 15 Nov 89 17:37:30 GMT



  A couple of days ago I posted this query.  I got one response which
  didn't answer the question, but a couple of other messages posted
  gave me the information to do what I wanted.

  There are two ways:

  1) Fixes the problem in general (works for xfig, xdbx, and xman, at least):
     add to your ~/.Xdefaults file the line:
	*Input: true
     and restart xnews.

  2) Patch the source code for xfig and xdbx (I tried xman and couldn't find
     the right place). In xdbx, patch the file windows.c thus:

  120a121,129
  >     /* ask window manager for input focus: */
  >     {
  >       XWMHints wmhints;
  >       wmhints = XGetWMHints((XtDisplay(vpane), XtWindow(vpane));
  >       wmhints.input = True;
  >       wmhints.flags = InputHint;
  >       XSetWMHints(XtDisplay(vpane), XtWindow(vpane), &wmhints);
  >     }
  > 

    In xfig, patch main.c similarly, after (around line 333) "XtRealizeWidget(tool);" only change "vpane" above to "tool".

       Phillip L. Shaffer                        shaffer@crd.ge.com
       GE Corporate Research & Development       uunet!crd.ge.com!shaffer
       Building KW, Room D211
       P.O. Box 8, Schenectady NY 12301

--
Skip Montanaro (montanaro@crdgw1.ge.com)

lac@ecs.soton.ac.uk (Les Carr) (11/17/89)

news@bellcore.bellcore.com (news) writes:

>I'm prevented from running xnews full-time by the following problem: I
>can't get keyboard information to some Xt applications.    The two
>applications both respond fine to mouse input, but this is not
>sufficient.  One of them is the "xdvi" program -- if that helps.  The
>applications and the server are running on the same Sun-4 running
>4.0.3c. Both applications use the Athena Widget set.

I have had similar problems at our site. We are running xnews on a SUN4/110
with a CLX client on a remote 3/60. The problem is that output windows
are fine, but key press/release events don't get from the X-server to the
CLX process.  Further investigation reveals that it isn't possible
to `focus' the X-server's keyboard onto a window thrown up by
the remote client on the server's display.  With the current focus
set to the new window, mouse button events travel fine, but when
you hit keys they appear in the last window you had selected, not
the one in focus!

Any clues would be very very very welcome indeed!
===
L.Carr@ecs.soton.ac.uk               Les Carr
Tel: +44 703 593649                  Dept of Electronics and Computer Science
Fax: +44 703 593939                  University of Southampton
Telex: 47661 SOTONU G                Southampton  SO9 5NH  England
-- 
L.Carr@ecs.soton.ac.uk               Les Carr
Tel: +44 703 593649                  Dept of Electronics and Computer Science
Fax: +44 703 593939                  University of Southampton
Telex: 47661 SOTONU G                Southampton  SO9 5NH  England