From 7b5eb765586d442f1fd77bbd6ae98e8276d28b20 Mon Sep 17 00:00:00 2001 From: "\"John Hawthorn ext:(%22)" Date: Wed, 31 Dec 2008 18:49:54 -0800 Subject: make I/O errors silent --- src/xlib.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); } -- cgit v1.2.3