Tuomo Valkonen <[EMAIL PROTECTED]> writes:

> On Tue, Feb 15, 2005 at 06:09:04PM -0500, Etan Reisner wrote:
>> You can do this with things as they currently are, you'd just need to
>> ioncore.find_region the default WScratchpad (it's named WScratchpad) and
>
> Or you could scan _:screen_of():llist(2) for a WScratchpad (obj_is).

Not perfect yet, but this works:


-- send either the topmost transcient or the window itself if it has
-- no transcient to the scratchpad
function detach_topmost_transient_to_sp(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() == "WScratchpad") then
         sp = r
      end
   end
   sp:attach(to_detach)
   if not sp:is_active() then
      mod_sp.toggle_on(cwin:screen_of())
   end
end

(It seems it's possible to send the window to a WFloatWS inside the
layer 2, but I still didn't understand how ...)

-- 
Matthieu

Reply via email to