If you are referring to locking an Xvnc session via the
screensaver, then why is that needed? You can configure the VNC
session such that it requires TLS encryption and the user's Unix
password in order to connect, or you can configure it to require
SSH tunneling in order to connect. Both of those methods would
secure the VNC session a lot more effectively than enabling the
screensaver in the session. Enabling the screensaver is false
security, because you ideally do not want unauthorized users to
connect to the session in the first place. In any case, the
screensaver is a function of the window manager, and the
mechanisms to programmatically activate it vary depending on the
particulars of the window manager you are using. Thus, there
isn't much that the VNC server can do to control it.