[comp.windows.x] BUG and FIX in twm

doyle@ingr.com (Doyle Davidson) (03/09/89)

I have discovered and bug in twm and how to fix it. (If you have source)

The problems has to do with twm losing events.  This may show up as
windows not being mapped (displayed) etc.  It appears that Mr. LaStrange
goofed on a few calls to XSync() in that he forget the second parameter
that says whether or not to discard all events in the input queue.
In my program, twm was losing MapRequest events and windows would never
get mapped!

To solve the problem change the following in 'add_window.c':
    XSync(dpy);			<- this is the one that hurt
to
    XSync(dpy, False);


and in 'twm.c' change the TWO calls:
    XSync(dpy, screen);		<- screen? old X10 or something? 
to
    XSync(dpy, False);

If this is an already reported bug then pardon me but I just found this
and I noticed other people were having problems that seemed to be caused
by this.

Otherwise I like twm and use it myself.

------------------------------------------------------------------
Doyle C. Davidson              |
Intergraph Corp.               |  These comments are...
Workstation Graphics Standards |
1 Madison Industrial Park      |     \\  /
Huntsville, AL 35806           |      \\/
(xxx) xxx-xxxx                 |      /\\  clusively my own.
                               |     /  \\
..!uunet!ingr!b11!doyled!doyle |
..!uunet!ingr!doyle            |
------------------------------------------------------------------

toml@hpfcdq.HP.COM (Tom LaStrange) (03/12/89)

> I have discovered and bug in twm and how to fix it. (If you have source)
> 
> The problems has to do with twm losing events.  This may show up as
> windows not being mapped (displayed) etc.  It appears that Mr. LaStrange
> goofed on a few calls to XSync() in that he forget the second parameter
> that says whether or not to discard all events in the input queue.
> In my program, twm was losing MapRequest events and windows would never
> get mapped!
> 
> To solve the problem change the following in 'add_window.c':
    > XSync(dpy);			<- this is the one that hurt
> to
    > XSync(dpy, False);
> 
> 
> and in 'twm.c' change the TWO calls:
    > XSync(dpy, screen);		<- screen? old X10 or something? 
> to
    > XSync(dpy, False);
> 
> If this is an already reported bug then pardon me but I just found this
> and I noticed other people were having problems that seemed to be caused
> by this.
> 
> Otherwise I like twm and use it myself.
> 
> ------------------------------------------------------------------
> Doyle C. Davidson              |

Sorry about that, there should be a new version of twm available shortly
that has some new features and a bunch of bugs fixed.

--
Tom LaStrange

Hewlett Packard Co.               ARPA: toml%hpfcla@hplabs.hp.com
Graphics Technology Division      UUCP: hplabs!hpfcla!toml
Fort Collins, CO