[comp.windows.x] Help with sending events to non-existent windows

ceg@nova.stanford.edu (Chris Gronbeck) (07/03/90)

I have a program that maintains a list of windows that it sends data to
using XSendEvent.  If a user terminates a process with ^c that has a
window attached to it, the first program crashes with a BadWindow error.

The things I have tried are using XSetErrorHandler to nonfatal, which
didn't do anything (still printed out standard message and exitted) and
using XQueryTree to  check make sure window numbers are valid, but
windows were killed and the first program crashed before the XQueryTree
found out that the window no longer existed.

Any suggestions would be greatly appreciated.

Christopher Gronbeck  ceg@nova.stanford.edu

klee@wsl.dec.com (Ken Lee) (07/03/90)

In article <1990Jul2.192334.24507@portia.Stanford.EDU>, ceg@nova.stanford.edu
(Chris Gronbeck) writes:
|> The things I have tried are using XSetErrorHandler to nonfatal, which
|> didn't do anything (still printed out standard message and exitted)

I suspect that you did this improperly.  This is the correct way to handle
this problem.

Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@wsl.dec.com
uucp: uunet!decwrl!klee