On 04/10/06, Tuomo Valkonen <[EMAIL PROTECTED]> wrote:
On 2006-10-03, Jarrod Lowe <[EMAIL PROTECTED]> wrote:
> local regions = win:managed_list()
^^^^^^^^^^^^^^^^^^ empty
You probably want win:manager().
This did exactly what I asked for, thanks. Unfortunately, turns out my
plan is not as viable as I had hoped. It appears that the original
window does not appear in clientwin_list() by the time we have got
there.
So, I decided to change my approach, and hook on the closing of the
window, set a name, and then have the new window launched in the named
frame. This probably wouldn't work for the second window opened (due
to the open/close race) but at least I would only have to drag the
window into place twice. So, I tried:
----------------------------------------------------
function vnc.name(id)
io.stderr:write("unmap " .. id .. "\n")
local wins = ioncore.clientwin_list()
for i, win in pairs(wins) do
if win:xid() == id then
io.stderr:write("Found window\n")
local region = win:manager()
if region then
region:set_name("_vnc")
return
end
end
end
end
ioncore.get_hook("clientwin_unmapped_hook"):add(vnc.name)
----------------------------------------------------
I have not added code for checking this is the right window closing, yet.
However, it appears that the departing window is not in
clientwin_list() anymore either! I get the unmap message, but not the
found message.
I'm a bit stumped now as ti how to proceed. Is there a way of getting
the information about the departing window? Or does anybody have a
suggestion for an alternative approach?
--
Tuomo
Thanks,
--
Jarrod Lowe