You need to lock the screensaver before using the dm-lock tool to switch to the greeter.
For example:
gnome-screensaver-command -l dm-tool switch-to-greeter
You need to lock the screensaver before using the dm-lock tool to switch to the greeter.
For example:
gnome-screensav er-command -l
dm-tool switch-to-greeter