-- Move all windows on a WIonWS to a single frame and destroy the rest. collapse={} function collapse.move_managed(tgt, src) local l=src:managed_list() for _, m in l do tgt:attach(m) end end -- Improvement by Matthieu MOY : initializes tgt to ws:current(). -- The current frame becomes the unique frame of this workspace. function collapse.collapse(ws) local l=ws:managed_list() local tgt=ws:current() -- This was not initialized. for _, f in l do if obj_is(f, "WIonFrame") then if tgt ~= f then -- This has changed also. collapse.move_managed(tgt, f) f:close() end end end end -- Simpler, but moves the windows around -- more, which doesn't look good. function collapse.collapse2(ws) local l=ws:managed_list() local prevf for _, f in l do if obj_is(f, "WIonFrame") then if prevf then prevf:relocate_and_close() end prevf=f end end end