Window size detection