Some questions about session saving

Olivier Fourdan fourdan at gmail.com
Mon Nov 10 15:06:28 CET 2008


On Mon, Nov 10, 2008 at 1:28 PM, Chris G <cl at isbd.net> wrote:
> On Mon, Nov 10, 2008 at 01:14:06PM +0000, Olivier Fourdan wrote:
>> On Mon, Nov 10, 2008 at 11:52 AM, Chris G <cl at isbd.net> wrote:
>> > XFCE seems not to be saving sessions properly for me.  Every so often
>> > when I start up I get *all* my application windows started up in the
>> > same Workspace.
>> >
>> > Is this a known bug or have I misunderstood something or have I got a
>> > broken installation?
>>
>> Can you provide a bit more details about the applications? Can you
>> provide the content of ~/.cache/sessions/xfwm4-<sessionid>?
>>
> The applications are just a whole lot of Terminal windows (Gnome
> Terminal 2.24.1) and Firefox distributed over five workspaces.

Well, I've never seen firefox being restored in any session manager.

> The files in ~/.cache/sessions are:-
>
>    Thunar-117f000101000122400734000000079700002  xfwm4-117f000101000122410508700000177870000
>    Thunar-117f000101000122401935100000114400002  xfwm4-117f000101000122410529900000182560000
>    Thunar-117f000101000122632269200000073890002  xfwm4-117f000101000122414714200000064980000
>    xfce4-session-chris-ubuntu:0                  xfwm4-117f000101000122631611900000065490000
>    xfce4-session-chris-ubuntu:0.bak              xfwm4-117f000101000122631715800000065030000
>    xfwm4-117f000101000122401935100000114400000   xfwm4-117f000101000122632235000000063160000
>    xfwm4-117f000101000122410493800000064510001
>
> So which one refers to the current session?  :-)

The one that matches the session id. The session id of xfwm4 is given
by the xfce4-session-chris-ubuntu:0 session file

    grep xfwm4 ~/.cache/sessions/xfce4-session-chris-ubuntu:0

But I don't think it's actually that relevant, because I doubt there
is a bug i ntha code. To understand why, you need to understand how
that works. The session manager saves the list of applications to
restore, as given by the apps themselves. But there is no concept of
workspaces for the session manager, so it's up to the window manager
to place the windows on their original workspaces (this is why you
have two files. one for the session manager and another one for the
window manager).

But to do so, the window manager needs to "recognize" the windows,
based on the name, clas, resource name, etc. including the title. If
the WM fails to match the window with that data, it will not restore
the window in its original workspaces (or state actually). Since
Terminal and firefox update their window title continuously, that
breaks the matching and probably explain the behavior you describe.

Xfce Terminal works much better in this regard, but I've never seen
firefox working as expected, with any session manager I've seen.

Cheers,
Olivier.



More information about the Xfce mailing list