Warning, /plasma/plasma-desktop/design/screensaver is written in an unsupported language. File is not indexed.

0001 Plasma and the Screensaver
0002 ==========================
0003 
0004 There are three main pieces to the screensaver picture, two of which involve plasma.
0005 first is lockprocess, which manages the other two. second is the [k|x]screensaver binaries which just draw
0006 pretty pictures. third is plasma-overlay, which does the plasma stuff.
0007 
0008 lockprocess
0009 -----------
0010 This process manages plasma and the screensaver binaries, and ensures that once the screen is locked
0011 it *stays* locked until proper authentication is provided. It provides the unlock dialog too.
0012 If a screensaver or plasma-overlay
0013 crashes or becomes unresponsive, lockprocess will keep going, ensuring that a locked screen stays locked and can
0014 still be unlocked by the user. It's as small as possible to keep the chances of it itself crashing very small.
0015 The screensaver binaries are brought in via XEmbed, while communication with plasma-overlay happens
0016 over dbus.
0017 lockprocess also filters all keyboard and mouse events, passing them on to plasma-overlay as
0018 necessary. if it suspects that plasma-overlay is dead (ie. dbus failure), it won't pass on events,
0019 ensuring that the user never ends up with an unresponsive screensaver.
0020 
0021 plasma-overlay
0022 --------------
0023 This process is a plasma shell; it has a corona and a simple view, and loads its own containment.
0024 The containment used by plasma-overlay is very basic; just a customcontainment with a cashew
0025 and applet handles.
0026 
0027 the user can add applets, but not containments. there's configuration for transparency if you have
0028 compositing, or wallpaper if not (random wallpaper slideshow is my poor-man's-screensaver). all
0029 configuration and applet add/remove are disabled when the screen is locked.
0030 
0031 it communicates with lockprocess over dbus. lockprocess will send it into an idle mode after a while
0032 (where any events trigger the unlock dialog, and plasma-overlay uses a different transparency
0033 setting), and tell it to go into active mode when there's activity again. when an unlock action in
0034 plasma is activated, plasma-overlay asks lockprocess for permission, and lockprocess will ask the
0035 user for their password (or whatever other authentication method).
0036 
0037 when the screen is locked, plasma-overlay offers two actions to the user: leave screensaver and
0038 configure widgets. the first is what you'd expect; you enter your password and all of lockprocess goes
0039 away, letting you back into your desktop. the second is more like unlocking widgets in
0040 plasma-desktop: it brings you into configuration mode where you can add, remove and configure
0041 widgets. this config mode can also be reached from the screensaver kcm module. from config mode you
0042 can exit at any time without entering a password; you can also re-lock the screen, of course.
0043 
0044 if lockprocess vanishes from dbus, plasma-overlay will assume that it missed a signal to quit and
0045 will commit suicide. :) this is intentional; I got sick of dbus race conditions leaving me with a
0046 plasma-overlay hanging around if I moved the mouse just after the screensaver began to run.
0047 
0048 security
0049 ---------
0050 
0051 Plasmoids on the screensaver obviously present a security risk. this is being minimized as described
0052 in the security document.
0053 what makes it interesting is that we're less concerned with malicious
0054 plasmoids and more with malicious (or mischievous) users; a locked screen left unattended should not
0055 end up with goatse on it, or files deleted.
0056 
0057 Future Work
0058 -----------
0059 * Multi-screen support would be awesome
0060 * Plasmify the unlock dialog (either by using plasma theming or by having plasma-overlay run it)
0061