🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.misc
Article #338

Re: beep but no type :-(

#338
From: Eric Johnson
Date: Fri, 07 Dec 1990 14:41
82 lines
4222 bytes
In article <39649@rphroy.UUCP>, rhaar@rcsrlh.GMR.COM (Bob Haar CS50) writes:
> In article <1990Nov30.190816.16538@cs.olemiss.edu>, dave@cs.olemiss.edu
> (David E. Johnson) writes:
> |> To get the keyboard focus to go to all applications try the following
> |> line in your .Xdefaults (or whatever):
> |> 
> |> 	OpenWindows*FocusLenience:	true
> |> 
> 
> I tried this, but it doesn't work - at least it doesn't solve my
> problem. It does have the effect that keyboard focus follows
> the cursor as you move the mouse. However, some X11 programs still
> don't get keyboard focus. They never see keystrokes and the "banner"
> region never highlights to show keyboard focus.
> 
> my example - xlife  compiled and running on a Sun Sparc 1+, SunOS 4.1,
> OpenWindows 2.0, olwm window manager. The same executable executable
> works correctly on another Sparcstation that is identical, except 
> that he uses twm rather than olwm. 
> 
> This suggests either as problem with olwm, or some difference is
> defaults or configuration files.
> 
> 	Bob Haar   CSNET: HAAR@GMR.COM  UUCP: uunet!edsews!rphroy!rcsrlh!rhaar
> 	Computer Science Dept., G.M. Research Laboratories
> DISCLAIMER: Unless indicated otherwise, everything in this note is
> personal opinion, not an official statement of General Motors Corp.

The real issue here is that the arbiter of what well-behaved X Window
programs need to do, the Inter-Client Communications Conventions Manual
(or ICCCM) has not only changed, but it's been adopted by most recent
window managers. What this did is cause a lot of old X programs to no
longer run properly. I won't argue about whether these programs are
"broken" or not (the point is moot to me). Anyway, the problem is not
your window manager (unless something is seriously wrong). The problem
is that the window manager demands your X applications follow certain
rules and the X application isn't. You'll find this a lot using code
written for X11 Release 3 on an R4-based system. (OpenWindows 2.0 is based
on X11 Release 4.)

Here's what you need to do. When the X application sets it's Window
Manager Hints, it needs to set the InputHints flag to True. Some
Xlib code fragments are below:

Display         *Display;
Window          window;
XWMHints	*wmhints;

/* Allocate wmhints, using malloc(), XMalloc() or XAllocWMHints()... */

wmhints->input = True;
wmhints->flags = InputHint;   /* OR your other hints here as well... */

XSetWMHints( display, window, wmhints );

/* free wmhints... */

The code will probably be setting a number of hints, so use an OR (|)
operation to OR together the various hint bit masks in the flags field.

This problem is in the top ten of hassles in programming X. For more 
information on the above code, see pages 38-39 in Advanced X Window 
Applications Programming:

Johnson, Eric F. and Kevin Reichard, Advanced X Window Applications Programming,
MIS: Press, Portland, OR, 1990. ISBN 1-55828-029-4.

Now, if your programs are based on a toolkit, like Xaw (Athena), Xm (Motif)
Xt+ (or OLIT--Open Look) or XView (Open Look) you will need to do something
different. (I haven't had any probelms with Motif code, even running an
R3-based Motif program on an R4-based server.)  The general place to look
is for something similar to "InputHint" or "inputHint"--you'll want to 
set whatever to True.

Hope this helps,
-Eric

-- 
Eric F. Johnson               phone: +1 612 894 0313    BTI: Industrial
Boulware Technologies, Inc.   fax:   +1 612 894 0316    automation systems
415 W. Travelers Trail        email: erc@pai.mn.org     and services
Burnsville, MN 55337 USA
Technical Details
Message-ID: <1568@pai.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!julius.cs.uiuc.edu!news.cs.indiana.edu!msi.umn.edu!cs.umn.edu!sialis!dmshq!com50!pai!erc
References: <SHAWN.90Nov30143236@litsun8.litsun.epfl.edu> <39337@rphroy.UUCP> <39649@rphroy.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!julius.cs.uiuc.edu!news.cs.indiana.edu!msi.umn.edu!cs.umn.edu!sialis!dmshq!com50!pai!erc
From: erc@pai.UUCP (Eric Johnson)
Newsgroups: comp.windows.misc
Subject: Re: beep but no type :-(
Summary: You need to set the InputHint
Message-ID: <1568@pai.UUCP>
Date: 7 Dec 90 14:41:18 GMT
References: <SHAWN.90Nov30143236@litsun8.litsun.epfl.edu> <39337@rphroy.UUCP> <39649@rphroy.UUCP>
Distribution: comp
Organization: Boulware Technologies, Inc., Burnsville, MN
Lines: 82