Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!halley!leghorn.mpd.tandem.com!tjd From: tjd@leghorn.mpd.tandem.com (Tom Davidson) Newsgroups: comp.windows.x Subject: Re: twm seems to interfere with xterm Keywords: twm, xterm Message-ID: <606@halley.UUCP> Date: 10 Oct 89 14:29:48 GMT References: <161@sdipl.oz> <595@halley.UUCP> <1124@celit.fps.com> Sender: news@halley.UUCP Reply-To: halley!tjd@cs.utexas.edu Organization: Tandem Computers Lines: 163 > > > >I'm trying to run xterm when using twm. As soon as twm gets going and > > >reparents the xterm, keypresses don't make it to xterm anymore. Button > > >presses (ctl mouse 1 etc) all work fine. Mouse movements cause the > > >appropriate focus change, the title bar icons work, just no characters > > >that are typed make their way to xterm. > > That's exactly what happens on my machine. I suspect some version mismatch, > or out of date software. I'm runnig X11.R2 on an Apollo DN3500. My 'twm' is > from the uunet archive (presumably R3), but I did not apply the patches yet. > > >This sounds as if you have function keys defined in your .twmrc (eg the Sun > >L5 for expose, L7 for close) which do not exist on your X terminal. Get rid > >of the definitions for these (or change them to F keys) in the .twmrc and > >try it. > > twm: unknown key name "ClearLine" > There is really no such key on my terminal, so I deleted any reference > to ClearLine from .twmrc. It still doesn't work, even after focus/defocus. > > Besides making xterm deaf and blind, my twm dies by 'Segmentation error' > when I want to deiconify some windows, or bring up a new one. When I move > a window, the new position is not repainted properly. > > Is there a patched twm available on some archive ? Ok, here's what I found. When I removed definitions for unknown keys, everything was forgiven and twm & xterm ceased their squabble over the keyboard. Good boys. I suspect that your source may have become corrupted resulting in the segmentation errors as I have never seen twm crash; R2 or R3. I received a patch for the unknown keys problem, but although it works, I'm unhappy that it complains about unknown keys. This makes it ugly to build a single .twmrc file for multiple machines. (oh no, a .twmrc-ipaddr file???). Not compliaining would be misleading in the simple sense. patch enclosed... #! /bin/sh # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting test in a file # #key.patch #orphans.patch # # Created by toml () on Fri Jul 14 10:58:58 MDT 1989 # if test -f 'key.patch' then echo shar: will not over-write existing file "key.patch" else echo extracting "key.patch" sed 's/^X//' >key.patch <<'SHAR_EOF' X*** orig/menus.c Thu Apr 27 08:29:16 1989 X--- menus.c Wed Jun 7 07:58:21 1989 X*************** X*** 137,147 **** X { X FuncKey *tmp; X KeySym keysym; X X! if ((keysym = XStringToKeysym(name)) == NoSymbol) X { X! fprintf(stderr, "twm: unknown key name \"%s\"\n", name); X! return; X } X X /* see if there already is a key defined for this context */ X--- 137,153 ---- X { X FuncKey *tmp; X KeySym keysym; X+ KeyCode keycode; X X! /* X! * Don't let a 0 keycode go through, since that means AnyKey to the X! * XGrabKey call in GrabKeys(). X! */ X! if ((keysym = XStringToKeysym(name)) == NoSymbol || X! (keycode = XKeysymToKeycode(dpy, keysym)) == 0) X { X! fprintf(stderr, "twm: unknown key name \"%s\"\n", name); X! return; X } X X /* see if there already is a key defined for this context */ SHAR_EOF if test 879 -ne "`wc -c < key.patch`" then echo shar: error transmitting "key.patch" '(should have been 879 characters) ' fi fi if test -f 'orphans.patch' then echo shar: will not over-write existing file "orphans.patch" else echo extracting "orphans.patch" sed 's/^X//' >orphans.patch <<'SHAR_EOF' Xdiff -c orig//add_window.c ./add_window.c X*** orig//add_window.c Thu Apr 27 08:29:13 1989 X--- ./add_window.c Thu Apr 27 08:32:16 1989 X*************** X*** 338,343 **** X--- 338,360 ---- X tmp_win->icon = FALSE; X tmp_win->icon_on = FALSE; X X+ XGrabServer(dpy); X+ X+ /* X+ * Make sure the client window still exists. We don't want to leave an X+ * orphan frame window if it doesn't. Since we now have the server X+ * grabbed, the window can't disappear later without having been X+ * reparented, so we'll get a DestroyNotify for it. We won't have X+ * gotten one for anything up to here, however. X+ */ X+ if (XGetGeometry(dpy, tmp_win->w, &JunkRoot, &JunkX, &JunkY, X+ &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth) == 0) X+ { X+ free((char *)tmp_win); X+ XUngrabServer(dpy); X+ return(NULL); X+ } X+ X /* add the window into the twm list */ X tmp_win->next = TwmRoot.next; X if (TwmRoot.next != NULL) Xdiff -c orig//events.c ./events.c X*** orig//events.c Thu Apr 27 08:29:14 1989 X--- ./events.c Thu Apr 27 08:31:21 1989 X*************** X*** 656,661 **** X--- 656,663 ---- X } X X tmp_win = AddWindow(w); X+ if (tmp_win == NULL) X+ return; X if (tmp_win->wmhints && (tmp_win->wmhints->flags & StateHint)) X { X switch (tmp_win->wmhints->initial_state) SHAR_EOF if test 1363 -ne "`wc -c < orphans.patch`" then echo shar: error transmitting "orphans.patch" '(should have been 1363 charac ters)' fi fi # end of shell archive exit 0 Tom Davidson internet: halley!foghorn!tjd@cs.utexas.edu Tandem Computers, Inc. fax: (512) 244-8247 voice: (512) 244-8375 14231 Tandem Boulevard Austin, TX 78728-6610