We don't always get the focus change events. Argh!
--- a/src/video/x11/SDL_x11window.c Fri Sep 28 01:51:51 2012 -0700
+++ b/src/video/x11/SDL_x11window.c Fri Sep 28 02:15:44 2012 -0700
@@ -1238,8 +1238,8 @@
/* flush these events so they don't confuse normal event handling */
XSync(display, False);
- XIfEvent(display, &ev, &isFocusIn, (XPointer)&data->xwindow);
- XIfEvent(display, &ev, &isFocusOut, (XPointer)&data->xwindow);
+ XCheckIfEvent(display, &ev, &isFocusIn, (XPointer)&data->xwindow);
+ XCheckIfEvent(display, &ev, &isFocusOut, (XPointer)&data->xwindow);
} else {
XUngrabPointer(display, CurrentTime);
XUngrabKeyboard(display, CurrentTime);