HowScreenLockingWorks

Revision 2 as of 2010-01-07 14:08:53

Clear message

Debugging Central

This page is part of the debugging series — pages with debugging details for a variety of Ubuntu packages.

** This page is a work in progress **

Introduction

Screen locking is a complex combination of many different packages, applications, and tools. Different desktop environments, such as Gnome and KDE, do not lock the screen using the same applications. This wiki page documents the screen locking process for each desktop environment.

Gnome (Ubuntu)

Software

gnome-screensaver

gnome-screensaver is the main application that starts the screensaver, and displays the locked screen authentication dialog. It has an application to set preferences, and has a DBus interface. It also comes with a command-line tool called "gnome-screensaver-command" that can be used to control gnome-screensaver.

gnome-screensaver supports native "themes" and xscreensaver "hacks".

The screensaver can be activated in one of the following ways: with an idle timeout, or from being manually triggered by the user.

Beginning with Karmic, gnome-screensaver relies on gnome-session's idle signal, instead of using it's own idle watcher. (Ref.: https://bugzilla.gnome.org/show_bug.cgi?id=567919)

GNOME Power Manager

GNOME Power Manager is a session daemon that manages, among other things, automatically blanking the screen or suspending the computer after a timeout, or when the battery is low.

The screen blanking is unrelated to gnome-screensaver, and uses DPMS to actually turn the screen off. It uses a different idle timeout than the one set for the screensaver.

When GNOME Power Manager wants to put the computer into a suspend state, it performs the following steps:

  • Locks the GNOME Keyring
  • Using DBus, sends a "lock screen" signal to gnome-screensaver
  • Waits to get confirmation from gnome-screensaver that the screen is locked (with a 5 second timeout)
  • Tells DeviceKit-Power to suspend the hardware (prior to Karmic, HAL was used)

GNOME Power Manager waits for confirmation from gnome-screensaver before triggering the suspend so the hardware doesn't suspend while gnome-screensaver is fading the screen. If that happens, when the machine is resumed, the desktop will be visible for a couple of seconds before the lock screen authentication dialog appears.

Unfortunately, if gnome-screensaver is not running, or if it doesn't respond in 5 seconds, GNOME Power Manager will suspend anyway. This may result in bug reports about the desktop being visible after resume, or bug reports about resume not coming up with a locked screen.

(Ref.: src/gpm-{control,screensaver}.c in gnome-power-manager)

Indicator Applet

xdg-screensaver

"Lock Screen" gnome-panel applet

Screensaver Inhibiting

To be completed.

KDE (Kubuntu)

To be completed.

XFCE (Xubuntu, Mythbuntu)

To be completed.


CategoryBugSquad CategoryDebugging