I use gnome and so far I've been happy with my Ctrl+Alt+L shortcut in gnome. It used to lock up the screen when I was away from the desktop. However, recently, I've started to use XFCE and sometimes ratpoison, which didn't have this shortcut.
Anyways, the simpler way to lock your screen is from command line and it seems to work everywhere I've tried so far.
$xscreensaver-command -lockI just kept in here so that I don't forget. Maybe this little tip would be useful for some.
I just found an alternate method that can work too.