Re: sawfish has lost a window - window is found with xdotool



Janek Kozicki <janek_listy wp pl> writes:
> Jeremy Hankins said:     (by the date of Sat, 30 Oct 2010 12:49:03 -0500)
>
>> Don't know.  But I guess it could be falling off the bottom of a stack
>> someplace.
>
> e.g. a 128MB-sized stack?

Dunno.  But I was thinking maybe it's some poor memory management
someplace.  Whether in sawfish or X I don't know enough to guess -- and
without being able to reproduce it at will it'd be tough to isolate.

> wow, impressive. Now if I only knew how to run that :)
> Do I need to restart sawfish to run it?

It was meant to go in your .sawfishrc, then you'd need to restart.  But
here's a better idea.  Download a recent debug-utils from the wiki, and
it will have the window logger in it.  Put it in ~/.sawfish/lisp
(changing the first "D" to "d").  If have a version of debug-utils and
have a:

(require 'debug-utils)

in your .sawfishrc you'll need to restart, otherwise run this from
sawfish-client:

(require 'debug-utils)
(setq window-logger-poll-delay 60)
(window-logger-init)

If you want you cant stick this in your .sawfishrc to have it come on
whenever you start sawfish:

(require 'debug-utils)
(setq window-logger-poll-delay 60)
(add-hook 'after-initialization-hook window-logger-init)

Set window-logger-poll-delay to the seconds between polls for new/lost
windows.  60 seconds is the default and fine for me, but if you have so
many windows that running the poll takes noticeable time you may want to
increase that.

The log info will go wherever sawfish stderr goes.

> How do I unload this script afterwards?

Hmm.. Good idea.  ;)

I've just now uploaded a new version of debug-utils that includes a
window-logger-disable function.  (If the "Revision" tag at the top of
the file is 1257 or less it doesn't have it, 1263 is the most recent
version.)  Run "(window-logger-disable)" from sawfish-client to turn off
logging.  Also, if you want to change the polling interval you can set
window-logger-poll-delay and run "(window-logger-init)" and it will
(re)start logging with the new interval.

> Will this script work, even if there is already some window lost
> (before starting this script)? I mean - would it detect that my xterm
> was lost last week?

No, it wont.  It will only detect windows lost while it's running.  If
you really want to compare it to xwininfo output you could write a list
of windows from sawfish for feeding into a script from sawfish-client:

(setq f (open-file "file-name" 'write))
(format f "%s\n" (mapconcat window-name (managed-windows) "\n"))
(close-file f)

Or if you prefer window ids (in hex):

(setq f (open-file "file-name" 'write))
(format f "%s\n" (mapconcat (lambda (w) (format nil "%x" (window-id w))) (managed-windows) "\n"))
(close-file f)

-- 
Jeremy Hankins <nowan nowan org>


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