Re: Session Restoring All Windows on First Workspace

Jeremy Hankins <nowan nowan org> writes:

> Clinton Ebadi <clinton unknownlamer org> writes:
>> After a week of figuring out how all of the new desktop magic works I
>> have a working sawfish setup except for one thing: when I logout and
>> login all of my window are restored on workspace 0.

> Theoretically, I could use some other session manager and get the same
> results.  Any suggestions for a simple session manager that just manages
> a session?  Ideally I wouldn't have to spend much time futzing with
> it...

So it turns out that sawfish was actually not even starting properly!

After fixing things such that it was being started correctly... it
bombed out with a weird error and unhelpful backtrace. After a bit of
debugging and figuring out how the debugger worked... tada, I discovered
the problem was in lisp/sawfish/wm/user.jl. The last bit consumes *all*
command line arguments, and attempts to load anything it does not
recognize as a file, or, if it does not exist, as a module. And thus
sawfish died upon encountering "--sm-client-id".

I skimmed the librep manual about this and it does seem this is intended
behavior... I don't like it, but perhaps something relies upon the
destructive consumption of elements from `command-line-args'. If nothing
does I think the correct thing to do would be adopt standard getopt
semantics (and just ignore any unrecognized command line arguments under
the assumption something else will parse them later).

I've attached a patch.

From 0f95c48400b2091966f5d9408c677ea65cc3eac8 Mon Sep 17 00:00:00 2001
From: Clinton Ebadi <clinton doomfaring home unknownlamer org>
Date: Fri, 13 Aug 2010 04:23:55 -0400
Subject: [PATCH] Connect to session manager before parsing command before user init
 * Unrecognized command line arguments were being interned and passed
   to `required' which causes sawfish to abort when a session manager
   restored it as part of a session
 * Probably suboptimal, but seemingly unavoidable given the intended
   semantics of accessing `command-line-args'

 lisp/sawfish/wm.jl |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/sawfish/wm.jl b/lisp/sawfish/wm.jl
index 8c383eb..02190fc 100644
--- a/lisp/sawfish/wm.jl
+++ b/lisp/sawfish/wm.jl
@@ -149,9 +149,6 @@
   (sawfish-load-all "sawfish/wm/autoload")
   (sawfish-load-all (concat "os-" (symbol-name operating-system))))
-;; do user-level initialization
-(load "sawfish/wm/user")
 (let ((session-id     (get-command-line-option "--sm-client-id" t))
       (session-prefix (get-command-line-option "--sm-prefix" t)))
@@ -159,3 +156,8 @@
   ;; connect until they're ready to handle the later priority levels
   (when (and (not batch-mode) (getenv "SESSION_MANAGER"))
     (sm-init session-id session-prefix)))
+;; do user-level initialization
+(load "sawfish/wm/user")


Attachment: pgpznNYkJhkcv.pgp
Description: PGP signature

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