装好Xubuntu后,一直存在着这个不能锁屏的问题,但是自己一直在忙,也懒的去弄这个事情。刚刚今天下班比较早,就来处理了一下。Google了一下,发现这是一个已经报告的bug,已经有了解决方案。

https://bugs.launchpad.net/ubuntu/+source/xfce4-utils/+bug/200665

Binary package hint: xfce4-utils

  1. Ubuntu version: Xubuntu 8.04
  2. Source package: xfce4-utils and xfce4-panel
  3. Package version: 4.4.2-3ubuntu2
  4. What you expected to happen:

The "Lock screen" button should lock the screen.
5) What happened instead:

It doesn't lock the screen.
6) Steps to reproduce:

  1. Right click on the Panel -> Add New Item -> Action Buttons -> Add

  2. Select action type: Lock screen

  3. Click on the "Lock screen" button in the Panel.

  4. Nothing happening.

  1. Possible reason:

The "Action Buttons" panel plugin uses the /usr/bin/xflock4 script (provided by the package xfce4-utils).

This script try to use xscreensaver to lock the screen ("xscreensaver-command -lock"), but if xscreensaver isn't running, try to use gnome-screensaver ("gnome-screensaver-command --lock"), but if gnome-screensaver isn't running, try to use the "xlock" command to lock the screen.

But, by default, neither xscreensaver, nor gnome-screensaver is
running, and none of the packages providing "xlock" are installed
(xlockmore and xlockmore-gl).
8) Possible solutions:

  • Modify the xflock4 script, to show a warning, if xscreensaver or gnome-screensaver isn't running.

OR

  • Make xfce4-panel depend on xlockmore or xlockmore-gl, so it will be
    able to lock the screen, even if xscreensaver or gnome-screensaver
    isn't running.
    [9) Another suggestion: May be good, to use the keyboard shortcut
    Ctrl+Alt+L to lock the screen. Currently Ctrl+Alt+Del is used, but it
    could be useful, to let lock the screen also with Ctrl+Alt+L as in
    GNOME and KDE.]

查了一下我的Xubuntu,发现没有安装xlock,下载xlockmore安装后,问题解决。xlockmore可以在这里下载:http://ftp.debian.org/debian/pool/main/x/xlockmore/xlockmore-gl_5.22-1.4_i386.deb