RE: Move frames to and from scratchpad

Canaan Hadley-Voth <[email protected]>
Newsgroups gmane.comp.window-managers.ion.general
Message-ID <[email protected]>
>   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(_)"),
> 

There may or may not be a WGroupWS layer present between a WScreen and a WTiling, making this sort of maneuver even more difficult.  If you are over a floating workspace, or you created a tiling workspace with the following command, your way of attaching to it will fail:

_:screen_of:attach_new{type="WTiling"}

I have been using this function to do what you are trying to do.  (Though someone else might anticipate further cases where mine also fails, like a WClientWin attached (unframed) to a WGroupWS.)

function send_to_or_from_sp(cwin, jumpto)
    local sp=ioncore.lookup_region("*scratchpad*", "WFrame")
    if cwin:parent()==sp then
	local scr=cwin:screen_of()
	local destws=scr:mx_current()
	local destwstype=obj_typename(destws)
	if destwstype=="WTiling" then
	    destws:current():attach(cwin)
	elseif destwstype=="WGroupWS" and obj_typename(destws:current())=="WTiling" then
	    destws:current():current():attach(cwin)
	elseif destwstype=="WGroupWS" then
	    destws:attach_framed(cwin)
	end
	mod_sp.set_shown_on(scr, 'unset')
    else
	sp:attach(cwin)
    end

    if jumpto then
	cwin:goto()
    end
end

_________________________________________________________________
See how Windows Mobile brings your life together—at home, work, or on the go.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/
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.