  We report on the dynamics of localized structures in an inhomogeneous
Swift-Hohenberg model describing pattern formation in the transverse plane of
an optical cavity. This real order parameter equation is valid close to the
second order critical point associated with bistability. The optical cavity is
illuminated by an inhomogeneous spatial gaussian pumping beam, and subjected to
time-delayed feedback. The gaussian injection beam breaks the translational
symmetry of the system by exerting an attracting force on the localized
structure. We show that the localized structure can be pinned to the center of
the inhomogeneity, suppressing the delay-induced drift bifurcation that has
been reported in the particular case where the injection is homogeneous,
assumming a continous wave operation. Under an inhomogeneous spatial pumping
beam, we perform the stability analysis of localized solutions to identify
different instability regimes induced by time-delayed feedback. In particular,
we predict the formation of two-arm spirals, as well as oscillating and
depinning dynamics caused by the interplay of an attracting inhomogeneity and
destabilizing time-delayed feedback. The transition from oscillating to
depinning solutions is investigated by means of numerical continuation
techniques. Analytically, we use two approaches based on either an order
parameter equation, describing the dynamics of the localized structure in the
vicinity of the Hopf bifurcation or an overdamped dynamics of a particle in a
potential well generated by the inhomogeneity. In the later approach, the
time-delayed feedback acts as a driving force.
