XfceSMClient design

Brian J. Tarricone brian at tarricone.org
Mon Aug 24 03:02:55 CEST 2009


Some more stuff I'm thinking about, feedback would be welcome.

XSMP supports four different restart styles:

1. SmRestartIfRunning: if the app is running when the session ends and
gets saved, then it should be restarted the next time the session starts.

2. SmRestartAnyway: the app should be restarted regardless of whether or
not it's running when the session ends.

3. SmRestartImmediately: the app should be kept running at all costs; if
it quits, restart it right away.  This of course implies it should be
restarted at the beginning of the next session too.

4. SmRestartNever: the app should be run once, and then be removed from
the session right away.

#1 and #3 are obviously very useful, but I'm thinking about dropping
support for #2 and #4 from the client (xfce4-session will of course
continue to support all of these; I'm only talking about what
XfceSMClient will support).

#2 can be handled using XDG autostart.  The app runs at session startup
every time, and probably doesn't retain state.  If it does, it will know
how to clean it up and can do so on its own without the need for the
session manager.

The only useful thing that #2 does that autostart doesn't support is the
ability to set a ShutdownCommand which gets run when the session ends
(and doesn't require the app to be running)[1].  This makes it easy to
have a corresponding "autostop" command run for an autostart app.
Personally I'd be happy if this got solved in some other way, either via
a new key in the app's XDG autostart file, or via a separate
to-be-defined autostop mechanism.

#4, SmRestartNever is also easily implemented via XDG autostart: the app
that runs either deletes its autostart .desktop file, or adds a new one
to mark Hidden=true after running.

Dropping #2 also lets me drop support for ResignCommand and
ShutdownCommand as well, which simplifies things quite a bit.

Does anyone see any problem with dropping SmRestartAnyway and
SmRestartNever from the session client?

	-brian

[1] I'm actually not sure if xfce4-session supports SmRestartAlways or
ShutdownCommand properly.  I added support for 4.6, but it's not really
tested.  I'm not sure, but it's possible GNOME and KDE don't support
this either.



More information about the Xfce4-dev mailing list