The suspected shooter in an attack at a German mother-and-child shelter was involved in a custody dispute at the centre, according to police.