4. Given the equation about $x$
$$
x^{2}-6 x+(a-2)|x-3|+9-2 a=0
$$

has exactly two distinct real roots. Then the range of the real number $a$ is ( ).
(A) $a=-2$
(B) $a>0$
(C) $a=-2$ or $a>0$
(D) $a \leqslant-2$ or $a>0$
4. (C).

Solution 1: The original equation can be transformed into
$$
\begin{array}{l}
|x-3|^{2}+(a-2)|x-3|-2 a=0 . \\
\text { Let } t=|x-3|(t \geqslant 0), \text { then } \\
t^{2}+(a-2) t-2 a=0 .
\end{array}
$$

By the problem statement, equation (1) about $t$ has only one positive root. We discuss in two cases:
(1) When $\Delta=(a-2)^{2}+8 a=(a+2)^{2}=0$. That is, when $a=-2$, equation (1) has only one positive root $t=2$, which meets the requirement.
(2) When $-2 a>0$, equation (1) has one positive root and one negative root, which also meets the requirement.

In summary, the range of $a$ that makes the original equation have exactly two distinct real roots is $a=-2$ or $a>0$.
Solution 2: The original equation can be transformed into
$$
(|x-3|+a)(|x-3|-2)=0 \text {. }
$$

Then $|x-3|+a=0$ or $|x-3|-2=0$.
$\because|x-3|-2=0$ has two distinct real roots $x_{1}=1, x_{2}=5$.
$\therefore$ The equation $|x-3|+a=0$ either has the same roots as $|x-3|-2=0$ or has no real roots. Hence $a=-2$ or $a>0$.