mate-desktop/mate-file-manager — pull request #167 by clefebvre (2013-09-12 22:29:46+00:00)
Title: [To be tested] Fix for x-caja-desktop multiple windows being spawned on first login

This wasn't tested or verified yet. Please help with the testing.

Here's the theory:

- X-MATE-AutoRestart is set to TRUE in caja.desktop, meaning mate-session will automatically respawn caja whenever it either crashes or exits.

- Caja handles the desktop and the automounts and therefore needs to be running.

- On first login, say there's a race condition between /etc/skel, the creation of the various hidden files in the home dir and mate-session... what could happen is that mate-session would spawn caja while ~/.dconf isn't totally ready (this is just a theory...we don't know for sure what's going on). If caja failed to read exit_on_last_window from gsettings it would either crash or exits.. thus being restarted by mate-session.

This would explain why we get a series of caja spawn and they stop whenever dconf is ready.

It doesn't explain why they open windows though (maybe another bug in caja, or in mate-session losing arguments on autorestarts?).

Another aspect of this is that we don't need the setting exit-on-last-window. Caja always runs in the background and should always do. Using another filemanager is possible and mate-session will only pick one. Launching a second one in the same session would make both filemanagers stay in memory but that isn't a real problem (note that nemo for instance doesn't support such a setting).