summaryrefslogtreecommitdiff
blob: ac458e1f4f062d95d74815986bd57c4a5643b02c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff -Naurp xfractint-20.04p07/unix/unixscr.c xfractint-20.04p07-fixed/unix/unixscr.c
--- xfractint-20.04p07/unix/unixscr.c	2005-11-22 23:51:24.000000000 +0100
+++ xfractint-20.04p07-fixed/unix/unixscr.c	2007-12-28 13:40:50.000000000 +0100
@@ -137,6 +137,7 @@ static int doredraw = 0; /* 1 if we have
 static Window FindRootWindow(void);
 static Window pr_dwmroot(Display *dpy, Window pwin);
 static int errhand(Display *dp, XErrorEvent *xe);
+static int ioerrhand(Display *dp);
 static int getachar(void);
 static int handleesc(void); 
 static int translatekey(int ch); 
@@ -345,6 +346,30 @@ XErrorEvent *xe;
         return(0);
 }
 
+/*
+ *----------------------------------------------------------------------
+ *
+ * ioerrhand --
+ *
+ *	Called on an X IO server error.
+ *
+ * Results:
+ *	None.
+ *
+ * Side effects:
+ *	Prints the error message.
+ *
+ *----------------------------------------------------------------------
+ */
+static int ioerrhand(dp)
+Display *dp;
+{
+		UnixDone();
+        fflush(stdout);
+		printf("Fatal X IO error on display %s\n", DisplayString(dp));
+        return(0);
+}
+
 #ifdef FPUERR
 /*
  *----------------------------------------------------------------------
@@ -552,6 +577,7 @@ initUnixWindow()
       XSynchronize(Xdp, True);
     }
     XSetErrorHandler(errhand);
+	XSetIOErrorHandler(ioerrhand);
     Xsc = ScreenOfDisplay(Xdp, Xdscreen);
     select_visual();
     if (fixcolors > 0) {