Re: adding session-management to a wm




Tom Tromey <tromey@cygnus.com> writes:

> >>>>> "Chris" == Chris Cannam <cannam@all-day-breakfast.com> writes:
> 
> Chris> But if that's the case, I can't see how the wm could save any
> Chris> useful state other than the number of virtual desktops
> Chris> available, and in particular I don't see how it can ensure that
> Chris> a newly-restarted client comes up on the correct desktop next
> Chris> time you log in.  The wm surely can't make any association
> Chris> between previous and new instantiations of a client application
> Chris> unless it is a session manager itself... can it?
> 
> Nope, there's no way to do this.  It seems unbelievable to me right
> now (maybe it's too late at night?), but there it is.

Hmmmm, see:

 ftp://ftp.x.org/pub/R6.4/xc/doc/hardcopy/ICCCM/icccm.PS.gz

chapter 5.

In essence, the way it works is that a client is supposed to put it's
session manager ID in the SM_CLIENT_ID property on the client leader
window. A window is uniquely identified between sessions by the client
ID and either the WM_CLASS/WM_NAME pair or a special WM_ROLE property.

The window manager acts as another client of the session manager.

> I guess the answer is that clients should save all the state they care
> about, and the window manager should just save the state of those
> things it directly controls: various wm-specific options, what desktop
> you are looking at by default, geometry of wm-created windows, etc.
> 
> Chris> (Maybe there's some sort of idiot's guide on adding
> Chris> session-management support to a wm that I've overlooked?  Or
> Chris> maybe people who write window managers are just supposed to be
> Chris> clever.)
> 
> Or choice #3: the people who wrote the X session management stuff
> weren't wm implementors and didn't think it all the way through :-)

I think the basics work fine. The spec does prevent some useful
behaviors from being implemented - in particular, it would be nice to
be able to checkpoint a single application into a launcher button,
but there is no way in that case to associate the saved window
geometry with the saved session management information, since
they happen in different applications.
 
> Chris>  * Do the gnome libraries enable applications to use window
> Chris>  groups?  I'd rather like to support them, but I'm too lazy to
> Chris>  make the effort unless I know lots of new software is going to
> Chris>  make use.
> 
> I don't know.  I do know that one other popular X toolkit, Tk, does
> let you use window groups.  I've even written Tk applications that do
> this.


GDK does, sort of. All GDK windows are, by default members of
a single group with the leader window being a special window
created by GDK for that purpose. The window_group can be
changed with gdk_window_set_group(). However, it would be
much more convenient to be able to set this at the GTK level -
which is in my short-term plans for adding to GTK.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]