Razor-qt/razor-qt — pull request #175 by amoskvin (2012-01-16 21:21:53+00:00)
Title: Lock the screen when "Lock Screen" is selected

Currently, when clicking "Lock Screen", it executes "xdg-screensaver activate", which just turns off the screen. If XScreenSaver is running, it activates it, but the screen is not locked.

According to `man xdg-screensaver`, that just activates the screensaver. To really lock the screen, xdg-screensaver lock" needs to be run instead:

activate
Turns the screensaver on immediately. This may result in the screen
getting locked, depending on existing system policies.

lock
Lock the screen immediately.

However, if xscreensaver is not running, it obviously can't lock the screen, so I added xscreensaver to autostart, when it's available.

Of course, now it will give an error if the user attempts to lock the screen without it running (instead of just turning it off like it does now), but I think this is more correct.