fixed activeWindow with dirty monkey patch