fix activateDeactivateLayerRelatedActions (fixes #8005)