I need to run a very badly behaved application - vncviewer.

vncviewer, every time the far end resolution changes, opens a new
window, then closes the previous one (yes, in that order). Since I am
using vncviewer to remotely control machines attached to a KVM, this
happens about ten times every time you reboot a machine. If you are
trying to work in one window, and waiting for the remote machine to
reboot in another, you constantly get vncviewer reopening itself on
top of the application you are trying to use. However, I regularly
change which window I *do* want it in.

It occurred to me, that what I really want is to have vncviewer reopen
its new window into the same place as its existing one.

My first attempt at doing this is thus:
----------------------------------------------------------------------
function vnc.setup_hooks ()
 ioncore.gethook("clientwin_do_manage_alt"):add(vnc.manager)
end

function vnc.manager(cwin, table)
  local class = WClientWin.get_ident(cwin).class

  if class == "Vncviewer" then
    local wins = ioncore.clientwin_list()
    for i, win in pairs(wins) do
      if win:get_ident().class == "Gaim" then
        io.stderr:write("found gaim\n")
        local regions = win:managed_list()
        for reg in regions do
          io.stderr:write("attach\n")
          reg:attach(cwin)
        end
      end
    end
  end

  return false
end

vnc.setup_hooks()
-------------------------------------------------------------------

I am trying to place it in the Gaim windows location, as it is easier
to test. The output I get is "found gaim", but never "attach"

This is a simplified version - I know it will sequentially try to
attach in multiple places (well, if it worked), but code to handle
that is not relevant to the problem, so I have stripped it out.

I am using WIonWS if it makes any difference. I don't need this to
work on WFloatWS.

Can anybody see what I am doing wrong?

Thanks,
--
Jarrod Lowe

Reply via email to