We study a simple model of the class D laser with allowance for the spectral and spatial inhomogeneity of an active medium, whose polarization relaxation rate is much smaller than the field relaxation rate in a resonator. We consider the cases of one-, two-, and four-mode lasing for which the stationary, pulsed, self-modulation, and quasi-chaotic of laser dynamics are numerically studied. The laser parameters are chosen to correspond to the experiments on the Bose-Einstein condensation of dipolar excitons in semiconductor traps with quantum wells, which open up a possibility for creating class D lasers for the first time.