--- /dev/null
+--- ion3.orig/ioncore/rootwin.c
++++ ion3/ioncore/rootwin.c
+@@ -58,10 +58,11 @@
+ static char msg[128], request[64], num[32];
+
+ /* Just ignore bad window and similar errors; makes the rest of
+- * the code simpler.
++ * the code simpler. Due to a Xorg bug, window lookups may fail
++ * with BadMatch instead of BadWindow.
+ */
+ if((ev->error_code==BadWindow ||
+- (ev->error_code==BadMatch && ev->request_code==X_SetInputFocus) ||
++ ev->error_code==BadMatch ||
+ (ev->error_code==BadDrawable && ev->request_code==X_GetGeometry)) &&
+ ignore_badwindow)
+ return 0;