aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xlib.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xlib.c b/src/xlib.c
index e1730aa..b8163a2 100644
--- a/src/xlib.c
+++ b/src/xlib.c
@@ -142,6 +142,12 @@ void setaspect(unsigned int w, unsigned int h){
XFree(hints);
}
+/* Alt-F4 silent. Keeps people happy */
+int xquit(Display *d){
+ exit(EXIT_SUCCESS);
+ return 0;
+}
+
void xinit(){
display = XOpenDisplay (NULL);
assert(display);
@@ -154,6 +160,8 @@ void xinit(){
XMapRaised(display, window);
XSelectInput(display, window, StructureNotifyMask | ExposureMask | KeyPressMask);
XFlush(display);
+ XSetIOErrorHandler(xquit);
+ XFlush(display);
}