Generalized Eck peak in inhomogeneous Josephson junctions