Currently, xfce4-session starts up somehow like that:
- if the session file is missing, it reads xfce4-session.xml and executes the programs specified
- if the session file is present, it executes the programs specified there, and does not consult xfce4-session.xml
This is not a good way for starting essential processes (window manager, panel, desktop), because it may happen that an essential processes is not started.
For example, if, when logging out, an essential processes fails to save itself, the session manager may forget about it. This has happened to me with xfwm4: when logging out, it seemed that xfwm4 failed to save itself and the session manager timed out, forgetting about xfwm4. This way xfwm4 was not started on next login.
Another (hypothetical) example is if, starting with no session file, an essential process crashes at initialization before it manages to contact the session manager. In this case the session manager will not even know about the process - it will not attempt to restart it, and will not start it on next login.
I have a proposal on how the session manager could attempt to ensure that essential processes are always started. I can implement it, but please provide feedback.
Remove the "failsafe session" from xfce4-session.xml. Instead, xfce4-session.xml contains a list of so-called services. Each service has a command for starting it. This command requests the service to use a given client ID (with a substitution like %c) (e.g. xfwm4 --sm-client-id=%c). Each service also has a unique name.
When the session manager determines to start a service in a fresh state (e.g. with no session file), it generates a new client ID, than starts the service process, passing it the new client ID (see 1.). The service process then (hopefully?) connects to the session manager using the given client ID. This way the session manager recognizes that client as belonging to a particular service.
On log out, the session manager requests all clients to save themselves, then saves restore info into the session file. However, when saving the info of a client that belonged to a service, it also saves the unique service name.
When the session manager starts up, it goes through all the services in xfce4-session.xml. For each service, it checks if there is a client in the session file belonging to that service. If there is, it will start the service using the information in the session file. If there is none, it will start it as described in (2.).
The net result of this is that if an essential process for some reason disappears from the session file, it will still be started on login, and e.g. the user will not be left without a window manager.
I expect these modifications to require relatively little changes to the source code of the session manager.
And what is someone wants to start a session with no panel?
(In reply to comment #1)
> And what is someone wants to start a session with no panel?
He copies the system-installed xfce4-session.xml to his local xfce configuration and removes the entry for the panel.
This will however affect all sessions. It could be done per-session by e.g. manually specifying a key to in session file to use a different xfce4-session.xml (name only, e.g. xfce4-session-nopanel).
I am experiencing a similar problem on two different Gentoo amd64 computers.
The list of restored apps seems random. Also KDE apps are never restored (in my case, yakuake, kopete and konversation).
How can I help debug and/or workaround this?
*** This bug has been marked as a duplicate of bug 828 ***