After following some of the discussion here regarding layer shenanigans,
I figured I'd see it working for myself.

I think there's a bug in ion that causes it lock up and chew cpu, but I am
having a hard time reproducing it, I'll post more on it laster.

However, here's what I have glued together so far, it's not terribly pretty,
but it does seem to work. This is based off of recent discussion here.

Put the attached script in ~/.ion3/cfg_floaty.lua, load it and put this in 
your WFrame menu:

definectxmenu("WFrame", {
   -- ... other stuff before this, perhaps
   menuentry("Send to layer 2", "detach_and_float(_sub)"),
        -- ... 
})

Bring up the menu for frame tabs, and select 'send to layer 2'
It seems to work ok for me. Seems to work ok for me.

-Jordan
defbindings("WScreen", {
        kpress(MOD1.."space", "toggle_floaty(_)")
})

function toggle_floaty(ws)
   local sp = nil
   for _,r in ws:llist(2) do
      if (r:name() == "FloatyFun") then
         sp = r
      end
   end

        if sp then
                if (ws:l2_hidden(sp)) then
                        ws:l2_show(sp)
                else
                        ws:l2_hide(sp)
                end
        else
        end
end

function detach_and_float(cwin)
   local to_detach = cwin
   local l=cwin:managed_list()
   local trs=l[table.getn(l)]
   if trs then
      to_detach = trs
   end
   local sp = nil
   for _,r in cwin:screen_of():llist(2) do
      if (r:name() == "FloatyFun") then
         sp = r
      end
   end
        if (sp == nil) then
                sp = cwin:screen_of():attach_new{type = "WFloatWS", 
                        passive = false, layer = 2, name = "FloatyFun", 
                }
        end
   sp:attach(to_detach)
   if not sp:is_active() then
                to_detach:goto()
   end
end


Reply via email to