I have finally discovered a clue why Metacity sometimes loses its ability to manage windows and pointer focus. It happens when I run a Qt program. I didn't realize this until I ran a second Qt program some time after the first. (The programs were Qgit and Valkyrie.) It doesn't seem to matter whether it's Qt3 or Qt4. It's hard to blame Qt for this, but I find myself avoiding Qt programs anyway. Restarting Metacity doesn't help; it's as if something is messed up in the X server. Maybe I'll switch to a new window manager. Can't switch to a new X server!