It looks like the problem is SDL related, and has to do with keyboard functionality rather than window focus. When I launch an xterm, and launch an SDL program from there (like MAME or RetroFE), and then close that program, my keyboard doesn't work. If I launch a non-SDL program like Firefox in stead, no such problem occurs. It's as if the SDL program grabs the keyboard, and refuses to release it even after it's closed down. Very very odd. It works perfectly well when I use KDE, just not when I don't use a window manager.