aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author"John Hawthorn ext:(%22) <jhawthor@uvic.ca>2008-12-31 18:49:54 -0800
committer"John Hawthorn ext:(%22) <jhawthor@uvic.ca>2008-12-31 18:49:54 -0800
commit7b5eb765586d442f1fd77bbd6ae98e8276d28b20 (patch)
treeb6f6a88f6af2bb2ed36dae6db90bd59acbd796a8
parentd18da616dc9a06dca907e74f9f316c6ea3dbb55c (diff)
downloadmirror-meh-7b5eb765586d442f1fd77bbd6ae98e8276d28b20.tar.gz
mirror-meh-7b5eb765586d442f1fd77bbd6ae98e8276d28b20.tar.bz2
mirror-meh-7b5eb765586d442f1fd77bbd6ae98e8276d28b20.zip
make I/O errors silent
-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);
}