Some questions about session saving

Chris G cl at isbd.net
Mon Nov 10 15:15:22 CET 2008


On Mon, Nov 10, 2008 at 02:06:28PM +0000, Olivier Fourdan wrote:
> 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.
> 
Well fvwm manages it perfectly!  It was one of the reasons I've stayed
with fvwm for so long.  I have the following in my fvwm configuration file:-

    #
    #
    # Styles for starting specific windows/apps on specific pagesD, the
    # parameter identifying the window can be the 'Name' (Window Title),
    # Class,
    #
    Style Home StartsOnPage 0 0 0
    Style News StartsOnPage 0 0 0
    Style Mail StartsOnPage 0 0 0
    Style Firefox-bin StartsOnPage 2 0 0, SkipMapping
    Style Firefox-bin MinOverlapPlacement
    Style Browser StartsOnPage 2 0 0, SkipMapping
    Style Notes StartsOnPage 2 0 0, SkipMapping
    Style DevA StartsOnPage 3 0 0, SkipMapping
    Style DevB StartsOnPage 3 0 0, SkipMapping
    Style Windows StartsOnPage 5 0 0, SkipMapping

I start up the Terminal windows with "-t <name>" to match the above
names in the Style operator and the terminals are placed as specified.

Similarly *any* Firefox window is recognised as "Firefox-bin" and gets
placed on workspace two.

-- 
Chris Green



More information about the Xfce mailing list