Proper window resizing detection