Detecting Loss/Gain of Focus

I’m porting a Windows-based app to run on Mac/Linux/Windows with the same codebase and that seems to indicate GLUT as the prime candidate for the window manager. One of the features of the original app is to automatically pause when focus is lost and restart when focus is regained. I can’t find a GLUT feature that supports that, so I have two questions:

  1. Am I just missing it and it’s in there somewhere?
  2. Is there another portable scheme for detecting focus loss and gain?

Any suggestions appreciated. The project is near completion (for Mac OSX and Windows; not yet tested on Linux) and this is one of the final touches.

I don’t think so in glut, but you can switch to SDL for that, and that works with macs / linux / windows–that is, if it isn’t too late.