Re: Move frames to and from scratchpad

Tuomo Valkonen <[email protected]>
Newsgroups gmane.comp.window-managers.ion.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.