How to control ‘crying windows’