[comp.windows.x] when you know you're dead

wohler@sri-spam.istc.sri.com (Bill Wohler) (04/17/87)

  i've got an application that spits out the following if i hit it with
  xdestroy:
  
X Error: parameter not a Window
         Request code: 40
         Request function: 3
         Request window 0x2f10084
         Error Serial #43
         Current serial #48

  i have several questions.  first, other than "request window", what
  do the other codes and numbers tell me?  second, what is the method
  by which you tell that you've been hit with a XDestroyWindow and
  should exit quietly?  what should i look for when looking at the X
  sources for examples?

  sorry for the mundane question, but you have to start somewhere...

							--bw

swick@ATHENA.MIT.EDU.UUCP (04/17/87)

>  i've got an application that spits out the following if i hit it with
>  xdestroy:
>  
> X Error: parameter not a Window

Which is exactly why xdestroy is a monstrous kludge.  It's an enormously
unfriendly action to unilaterally destroy someone else's resources and X10
provides you no assistance in handling this gracefully.  Your best best
is to set a flag once you're sure you've successfully done some operation
to your window (XSync() will help here) and then install your own error
handler.  You can safely assume that if the window disappears later, you've
been nuked by someone like xdestroy.  X11 has, of course, an explicit
DestroyNotify event so you know to stop doing things to the affected windows,
but requests already in the pipe at the time the destroy is executed will
still return errors.

The other entries in the error report won't help you much in this case.

-Ralph R. Swick
 DEC/MIT Project Athena