Windowing is a technique used in Finite Impulse Response (FIR) filter design to control the frequency response characteristics. It performs all the functions mentioned.
It truncates the infinite impulse response of an ideal filter, so that it can be realized using finite elements.
It minimizes the power leakage in sidelobes by reducing their amplitude and distributing the power over a wider frequency band.
It may also result in a wider main lobe due to truncation, which also increases the transition band width.