Mark Vojkovich <[EMAIL PROTECTED]> writes:

> On Sun, 3 Mar 2002, Gniazdowski Mariusz wrote:
> 
> > Hi.
> > 
> > Sometimes it happens - work in some vi, staroffice, gimp etc etc and bum -
> > "Signal 11 server crash"... With Mandrak8.1 it happens very rarely,
> > however it happens.
> > 
> > So, are there chances to make it look like "Hey XFree did receive signal
> > X11, save your work and prepare to shut down" ?
> 
>    From the client's point of view there's little difference between
> the X-server segfaulting and someone hitting the little 'X' button
> that the window manager puts next to the title bar (for most window
> managers, the 'X' is equivalent to xkill - the connection to the 
> server is severed).

Luckily there is actually a protocol in the ICCCM for the window manager
to the send the application a polite request to shutdown, and this
is what the 'X' typically does, though many window managers will
also have an option for more forceful xkill style termination.

(After all, the app should have the option to put up a dialog about
saving unsaved files, or whatever.)

>    Any client can install a handler via Xlib to respond to this
> occurance.  Most don't.  They probably should given how the same
> problem would happen just by "closing" the window.

Unfortunately, it's very hard to react to losing the connection to
the X server cleanly... the error handler you install is not allowed
to return, so basically all you can do is hope that your app is
sufficiently reentrant from whatever place was making the X call
to allow you to do an autosave. (Interaction with the user is clearly
not possible.)

This, BTW, makes it impossible to write an X app that robustly
connects to multiple displays and cleans up when it loses the connection
to one of them... I think Jim said something about having plans to
fix this at some point.

Regards,
                                        Owen
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to