Xnest: Remove socket and its lock file on exit
https://bugs.freedesktop.org/show_bug.cgi?id=11484 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
This commit is contained in:
parent
8b29addc30
commit
c13a48e74e
|
@ -17,6 +17,9 @@ is" without express or implied warranty.
|
|||
#include <xnest-config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include "screenint.h"
|
||||
|
@ -52,6 +55,14 @@ Pixmap xnestScreenSaverPixmap;
|
|||
XlibGC xnestBitmapGC;
|
||||
unsigned long xnestEventMask;
|
||||
|
||||
static int _X_NORETURN
|
||||
x_io_error_handler (Display *dpy) {
|
||||
ErrorF("Lost connection to X server: %s\n", strerror(errno));
|
||||
CloseWellKnownConnections();
|
||||
OsCleanup(1);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void
|
||||
xnestOpenDisplay(int argc, char *argv[])
|
||||
{
|
||||
|
@ -60,7 +71,9 @@ xnestOpenDisplay(int argc, char *argv[])
|
|||
int i, j;
|
||||
|
||||
if (!xnestDoFullGeneration) return;
|
||||
|
||||
|
||||
XSetIOErrorHandler(x_io_error_handler);
|
||||
|
||||
xnestCloseDisplay();
|
||||
|
||||
xnestDisplay = XOpenDisplay(xnestDisplayName);
|
||||
|
|
|
@ -198,6 +198,8 @@ xnestCollectEvents(void)
|
|||
case DestroyNotify:
|
||||
if (xnestParentWindow != (Window) 0 &&
|
||||
X.xdestroywindow.window == xnestParentWindow)
|
||||
CloseWellKnownConnections();
|
||||
OsCleanup(1);
|
||||
exit (0);
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue