  We propose a new mechanism for stabilization of confined modes in lasers and
semiconductor microcavities holding exciton-polariton condensates, with
spatially uniform linear gain, cubic loss, and cubic self-focusing or
defocusing nonlinearity. We demonstrated that the commonly known background
instability driven by the linear gain can be suppressed by a combination of a
harmonic-oscillator trapping potential and effective diffusion. Systematic
numerical analysis of one- and two-dimensional (1D and 2D) versions of the
model reveals a variety of stable modes, including stationary ones, breathers,
and quasi-regular patterns filling the trapping area in the 1D case. In 2D, the
analysis produces stationary modes, breathers, axisymmetric and rotating
crescent-shaped vortices, stably rotating complexes built of up to $8$
individual vortices, and, in addition, patterns featuring vortex turbulence.
Existence boundaries for both 1D and 2D stationary modes are found in an exact
analytical form, and an analytical approximation is developed for the full
stationary states.
