Snapping the 3D cursor to a grease pencil selection would include locked layers in the computation of the centroid. This is inconsistent with 4.2. The fix makes sure that we skip over layers that are locked. Pull Request: https://projects.blender.org/blender/blender/pulls/129639