Re: Detach a transient from a frame

Matthieu Moy <Matthieu.Moy-wMUr/[email protected]>
Newsgroups gmane.comp.window-managers.ion.general
Message-ID <[email protected]>
Tuomo Valkonen <[email protected]> writes:

> On 2007-05-28, Matthieu Moy <Matthieu.Moy-wMUr/[email protected]> wrote:
>> It should be unnecessary, but there's a bug. The name remains
>> WGroupCW<something> until the first redraw (resize the frame or so).
>
> Hmm. Maybe I'd call it a feature :). The name of the group does not
> change, and displayname changes are not signalled at all.
>
> However, if you do as I explained in the follow-up posting, the name
> should be initially correct.

OK, I didn't understand the explanations at first (btw, {bottom = ...}
and {reg = ...} are not documented on
http://modeemi.cs.tut.fi/~tuomov/ion-doc-3/ionconf/node7.html ).

I think I've got it now:


detach = {
   
}

function detach.topmost_transient(cwin, float)
   local reg = cwin
   while obj_typename(reg) ~= "WGroupCW" do
      reg = reg:manager()
   end
   ioncore.defer(function ()
                    local cwing = {}
                    if float then
                       cwing = cwin:geom()
                    end
                    local managed_list = {{ reg = cwin, bottom = true}}
                    local newparam = {type = 'WGroupCW', sizepolicy = 'free', switchto = true, managed = managed_list, geom = cwing}
                    local g = reg:manager():attach_new(newparam)
                    if float then
                       ioncore.detach(g, 'set')
                       g:goto()
                    end
                 end)
   return false
end

-- 
Matthieu
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.