Zenity, sessions, and window matching

It has been pointed out that session management in Metacity is currently a bit broken. Firstly, it leaves a lot of useless files around. I assume that the only session file which is really necessary is the most recent one. Secondly, I recently found and fixed a bug where Metacity actually crashed when attempting to save a session. I wonder nobody had found it before, but maybe this shows that session management doesn’t get used, or at least looked at, very much. Thirdly, there’s still a bug in the session management that I found the other day while fixing Zenity support, wherein it tries to put up a dialogue before closing the session… and then always quits, so you can’t see what you were told.

It seems to me that session management is three-quarters of window matching, but isn’t half as useful. It further seems to me that if window positions were remembered properly during day-to-day use, they would be remembered properly across sessions. This seems to be a rather compelling argument for dropping session handling entirely and adding some kind of window matching in its place. After all, it wouldn’t affect our claim to be a lightweight window manager to drop one broken feature and add a more useful one instead.

6 thoughts on “Zenity, sessions, and window matching”

I don’t see that much overlap between session management and window matching. Session management remembers the state of each application- at the very least, which documents were open, and potentially even things like the Undo stack for each application, but certainly not just where it should go on my desktop.

It’s true that session management also is supposed to remember the state of each application, but that’s nothing to do with the window manager. As far as the WM knows, all that’s needed is to place each window at the size and position it was at before, and on the same desktop.

There’s no question that session management is broken. The question I’m considering, though, is whether implementing window matching (i.e. the windows come back where you put them, both across sessions and during sessions) would do everything that session management does and more. It would be a fair amount of work to fix session management, and perhaps this work would be more fruitfully put into replacing it with window matching.