This should be done using ExoXsessionClient. The whole session should be a command line parameter, e.g. --restore-session [URI1;ROLE1;DISPLAY1][URI2;ROLE2;DISPLAY2].
Committed with revision 20105. 2006-02-27 Benedikt Meurer <benny@xfce.org> * thunar/main.c, thunar/thunar-application.{c,h}, thunar/thunar-dbus-client.{c,h}, thunar/thunar-dbus-service-infos.xml, thunar/thunar-dbus-service.c: Add session management support based on the ExoXsessionClient class. Bug #1415.
We need XSM (I should have known that before), as otherwise both startup and shutdown are not reliable (i.e. multiple start commands won't be "merged" properly using D-BUS).
Moving to 0.3.2beta2.
Committed with revision 21691. 2006-05-15 Benedikt Meurer <benny@xfce.org> * thunar/thunar-ice.{c,h}, thunar/thunar-session-client.{c,h}, thunar/main.c, thunar/Makefile.am, configure.in.in: Add session management support, based on XSM. Bug #1415.