README 2.96 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
See also http://live.gnome.org/SessionManagement/NewGnomeSession

Startup
-------

main() creates the GsmSession object representing the session (either
failsafe or normal). gsm_session_new() reads the appropriate autostart
and session files to create a list of GsmApps to be started.
(GsmAppAutostart represents an autostarted app, and GsmAppResumed
represents an app resumed from the previous saved session.)

12
Startup is divided into 7 phases (GsmManagerPhase):
13

14
    * GSM_MANAGER_PHASE_STARTUP covers gnome-session's internal
15
16
17
18
      startup, which also includes starting gconfd and dbus-daemon (if
      it's not already running). Gnome-session starts up those
      explicitly because it needs them for its own purposes.

19
20
21
22
23
24
25
    * GSM_MANAGER_PHASE_EARLY_INITIALIZATION is the first phase of
      "normal" startup (ie, startup controlled by .desktop files
      rather than hardcoding). It covers the possible installation of
      files in $HOME by gnome-initial-setup and must be done before
      other components such as gnome-keyring use those files.

    * GSM_MANAGER_PHASE_INITIALIZATION covers low-level stuff like
26
      gnome-settings-daemon helpers, that need to be
27
28
29
30
31
32
33
      running very early (before any windows are displayed).

      Apps in this phase can make use of a D-Bus interface
      (org.gnome.SessionManager.Setenv) to set environment variables
      in gnome-session's environment. This can be used for things like
      $GTK_MODULES, $GNOME_KEYRING_SOCKET, etc

34
    * GSM_MANAGER_PHASE_WINDOW_MANAGER includes window managers and
35
36
37
      compositing managers, and anything else that has to be running
      before any windows are mapped

38
    * GSM_MANAGER_PHASE_PANEL includes anything that permanently takes
39
40
41
      up screen real estate (via EWMH struts). This is the first phase
      where things actually appear on the screen.

42
    * GSM_MANAGER_PHASE_DESKTOP includes anything that draws directly
43
44
      on the desktop (eg, nautilus).

45
    * GSM_MANAGER_PHASE_APPLICATION is everything else (normal apps,
46
47
48
49
50
51
      tray icons, etc)

For each startup phase, GsmSession launches the appropriate GsmApps.
When apps connect to the XSMP or D-Bus servers, GsmClients are created
and added to the session. The session tries to map these clients to
GsmApps. GsmApps signal when they register (via XSMP or SN) or exit,
52
and GsmSession uses this to decide when the phase is complete.
53
54
55
56
57
58
59
60

FIXME: after starting the session, we need to run the DiscardCommands
of resumed apps.


Running/Shutdown
----------------

61
GSM_MANAGER_PHASE_RUNNING is pretty similar to the old gnome-session;
62
63
64
65
66
67
68
69
mostly it just tracks XSMP clients, and watches for
SmRestartImmediately clients exiting (NOTE: THIS DOESN'T HAPPEN YET).

GsmClient is in theory not XSMP-specific, but it's very very
XSMP-like, and the shutdown procedure is also very XSMP-like. This is
just because there's no way to do XSMP shutdown correctly otherwise.
However, GsmClientDBus will still be able to present a more sane
protocol to its clients than GsmClient presents to it.