On 2008-09-25, Canaan Hadley-Voth <[EMAIL PROTECTED]> wrote:
>
>> After trying several combinations, I found one that correctly brings a
>> frame from scratchpad to the background frame:
>> In Lua console:
>> _:screen_of():mx_current():current():current():attach(_sub)
>> In a key binding: kpress(META.."Shift+k",
>> "_:screen_of():mx_current():current():current():attach(_)"),
>>
>
> I have been using this function to do what you are trying to do.
You both are failing to simply recursively apply WRegion.current,
until something interesting is found. Something like:
reg=cwin:screen_of()
function scan(reg)
if not reg then
return nil
elseif obj_is(reg, "WFrame") then
return reg:attach(cwin)
elseif ... then
...
else
return scan(reg:current())
end
end
scan(cwin:screen_of())
Maybe it indeed makes sense to use WTiling attach if discovered,
as it can better find something useful, if the current isn't actually
a frame (unlikely).
--
Tuomo