If a Tcl app on one host is displaying a slave toplevel
on another host, and the remote host logs out (thus
yanking the X server out from under the window), then
the Tcl app dies with XIO error 131 (Connection reset
by peer). Any WM_DELETE_WINDOW protocol or <Configure>
binding on the window does not fire. There does not
seem to be any way in Tcl to catch and handle this
event. I happened to be using ActiveTcl 8.3.4.1, but I
think it's an intrinisic Xlib problem that would affect
any version.
This was discussed on c.l.t and in the Tcl chatroom.
Logged In: YES
user_id=68433
Notes:
The root cause of the problem is that XSetFatalErrorHandler
is Broken As Designed: the fatal error handler (which is
called when the server connection is closed unexpectedly) is
not allowed to return; and if it does, Xlib exit()s anyway.
It *might* be possible to detect the loss of the server
connection in the notifier prior to calling XNextEvent.
Need to investigate further how to clean up the resources
associated with the display if this occurs. I suspect it
will be extraordinarily tricky, due to the complexity of
Tk's shutdown logic.
Logged In: YES
user_id=72656
Is WM_SAVE_YOURSELF something the user can use here?