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>
|
#include <xnest-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include "screenint.h"
|
#include "screenint.h"
|
||||||
|
@ -52,6 +55,14 @@ Pixmap xnestScreenSaverPixmap;
|
||||||
XlibGC xnestBitmapGC;
|
XlibGC xnestBitmapGC;
|
||||||
unsigned long xnestEventMask;
|
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
|
void
|
||||||
xnestOpenDisplay(int argc, char *argv[])
|
xnestOpenDisplay(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -60,7 +71,9 @@ xnestOpenDisplay(int argc, char *argv[])
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
if (!xnestDoFullGeneration) return;
|
if (!xnestDoFullGeneration) return;
|
||||||
|
|
||||||
|
XSetIOErrorHandler(x_io_error_handler);
|
||||||
|
|
||||||
xnestCloseDisplay();
|
xnestCloseDisplay();
|
||||||
|
|
||||||
xnestDisplay = XOpenDisplay(xnestDisplayName);
|
xnestDisplay = XOpenDisplay(xnestDisplayName);
|
||||||
|
|
|
@ -198,6 +198,8 @@ xnestCollectEvents(void)
|
||||||
case DestroyNotify:
|
case DestroyNotify:
|
||||||
if (xnestParentWindow != (Window) 0 &&
|
if (xnestParentWindow != (Window) 0 &&
|
||||||
X.xdestroywindow.window == xnestParentWindow)
|
X.xdestroywindow.window == xnestParentWindow)
|
||||||
|
CloseWellKnownConnections();
|
||||||
|
OsCleanup(1);
|
||||||
exit (0);
|
exit (0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue