xiwm

simple window manager
git clone https://git.ce9e.org/xiwm.git

commit
c2aca97ff1040deef1cbf4e1a6aaa08b7ad54fa1
parent
2708b26ddb4dccae94acfb4635f56b1e51998960
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-10-17 05:35
rm xerror

Diffstat

M xiwm.c 26 +-------------------------

1 files changed, 1 insertions, 25 deletions


diff --git a/xiwm.c b/xiwm.c

@@ -95,7 +95,6 @@ static void sigchld(int unused);
   95    95 static const char broken[] = "broken";
   96    96 static int sw, sh;           /* X display screen geometry width, height */
   97    97 static int bh;               /* bar geometry */
   98    -1 static int (*xerrorxlib)(Display *, XErrorEvent *);
   99    98 static void (*handler[LASTEvent]) (XEvent *) = {
  100    99 	[KeyPress] = keypress,
  101   100 	[ButtonPress] = buttonpress,
@@ -138,27 +137,6 @@ sigchld(int unused)
  138   137 	while (0 < waitpid(-1, NULL, WNOHANG));
  139   138 }
  140   139 
  141    -1 /* There's no way to check accesses to destroyed windows, thus those cases are
  142    -1  * ignored (especially on UnmapNotify's). Other types of errors call Xlibs
  143    -1  * default error handler, which may call exit. */
  144    -1 int
  145    -1 xerror(Display *dpy, XErrorEvent *ee)
  146    -1 {
  147    -1 	if (ee->error_code == BadWindow
  148    -1 	|| (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch)
  149    -1 	|| (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable)
  150    -1 	|| (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable)
  151    -1 	|| (ee->request_code == X_PolySegment && ee->error_code == BadDrawable)
  152    -1 	|| (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch)
  153    -1 	|| (ee->request_code == X_GrabButton && ee->error_code == BadAccess)
  154    -1 	|| (ee->request_code == X_GrabKey && ee->error_code == BadAccess)
  155    -1 	|| (ee->request_code == X_CopyArea && ee->error_code == BadDrawable))
  156    -1 		return 0;
  157    -1 	fprintf(stderr, "xiwm: fatal error: request code=%d, error code=%d\n",
  158    -1 		ee->request_code, ee->error_code);
  159    -1 	return xerrorxlib(dpy, ee); /* may call exit */
  160    -1 }
  161    -1 
  162   140 int
  163   141 xerrordummy(Display *dpy, XErrorEvent *ee)
  164   142 {
@@ -826,11 +804,9 @@ killclient(const Arg *arg)
  826   804 		return;
  827   805 	if (!sendevent(sel[desktop], wmatom[WMDelete])) {
  828   806 		XGrabServer(dpy);
  829    -1 		XSetErrorHandler(xerrordummy);
  830   807 		XSetCloseDownMode(dpy, DestroyAll);
  831   808 		XKillClient(dpy, sel[desktop]->win);
  832   809 		XSync(dpy, False);
  833    -1 		XSetErrorHandler(xerror);
  834   810 		XUngrabServer(dpy);
  835   811 	}
  836   812 }
@@ -858,7 +834,7 @@ setup(void)
  858   834 	const unsigned int desktops = DESKTOPS;
  859   835 
  860   836 	XSync(dpy, False);
  861    -1 	XSetErrorHandler(xerror);
   -1   837 	XSetErrorHandler(xerrordummy);
  862   838 
  863   839 	/* clean up any zombies immediately */
  864   840 	sigchld(0);