Re: creating windows from rep

On Sun, 11 Jun 2006 10:55:38 +1000, Josh Babcock <jbabcock atlantech net> wrote:

Eric Mangold wrote:
On Sat, 10 Jun 2006 23:22:02 +1000, Josh Babcock
<jbabcock atlantech net> wrote:

Eric Mangold wrote:
On Sat, 10 Jun 2006 09:57:44 +1000, Josh Babcock
<jbabcock atlantech net> wrote:

How would I go about creating a window in a particular viewport? I want to launch a Firefox window in a particular place, but I already have a
matched window setting that I first need to ignore.


I've thought about how to tie a process to the windows it creates before
and haven't come up with anything useful. The situation is even more
difficult in Firefox's case, because the process you launch to open the window may in fact signal an already running Firefox process to open the
window on its behalf.

That can be prevented with the -no-remote option.

Basically I think you're stuck with matching the window when it gets
created, and switching it to the correct viewport then.

Hmmm. It would be nice if Firefox could be told to open a window with a
particular title. Since I don't feel like rebuilding Firefox, I'll let
that one go.

Can X and Sawfish tell how old windows are? If so, perhaps it would be
possibly to write a script that causes a window to appear, and then
modifies the most recent window.

I don't think you can tell how old windows are, but when you launch Firefox
you can just set some state and match the *next* window to be created.

Better yet would be to start a process
and get the window id back. then you could modify the window based on
the id.

I think what I will do is tell Firefox to start with some odd, unique
h/w dimensions and then match on those. Extremely ugly, but it should


Good luck!
Eric Mangold

I'm not sure I understand what you are saying, or how to do it (The only
thin I know about lisp is that you debug it by adding '}' characters to
the end of the file)


I mean you'll have a flag (variable) that you set when you want to match the next window. Then you'll hook window creation and check to see if that flag is set. If it is, then you handle that window and unset the flag.

e.g. At the top-level in your ~/.sawfish/rc file:

(define match-next-window nil)
(defun handle-new-window (win)
    (if match-next-window
        (progn (define match-next-window nil)
(add-hook 'after-add-window-hook handle-new-window)

Then you'll just need to do a (define match-next-window t) when you want the next window handled.


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