3 -- exchanges current client window with the active client window of the frame
4 -- called 'zoomframe' -- resembling the behavior of larswm
6 -- +---------------------------------------------------+-----------------+
13 -- | Z o o m f r a m e w i t h +-----------------+
14 -- | z o o m e d C l i e nt | |
20 -- +--------------------------------+------------------+-----------------+
23 -- | Client 4 | Client 3 |
26 -- +--------------------------------+------------------------------------+
28 -- Example: zoom_client on "Client 2" will put "Client 2" into the zoom frame
29 -- and "zoomed Client" into the frame of "Client 2"
31 -- By Rene van Bevern <rvb@pro-linux.de>, 2005
32 -- Modifications by Etan Reisner <deryni in #ion>
35 -- Example keybindings:
37 -- defbindings("WFrame", {
38 -- kpress(META.."z", "zoom_client(_, _sub)")
39 -- kpress(META.."z", "zoom_client(_, _sub, {swap=true})")
40 -- kpress(META.."z", "zoom_client(_, _sub, {swap=false, goto=true})")
43 -- zoom_client accepts a table that may contain the options 'swap'
44 -- and 'goto'. Both are by default set to 'true'.
46 -- 'goto' controls whether to switch to the zoomframe
48 -- 'swap' controls whether to bring the zoomframe's active client
49 -- into the current frame
52 -- Example configuration setup:
54 -- zoom_client_set({zoomframename = 'foo'})
57 zoomframename
= 'zoomframe'
60 function zoom_client_set(tab
)
61 settings
= table.join(tab
, settings
)
64 function zoom_client(curframe
, curclient
, options
)
65 local zoomframe
= ioncore
.lookup_region(settings
.zoomframename
, 'WFrame')
66 if options
== nil then
69 if options
.goto
== nil then
72 if options
.swap
== nil then
75 if (not zoomframe
) or (curframe
== zoomframe
) then
78 local zoomclient
= zoomframe
:lcurrent(1)
80 zoomframe
:attach(curclient
)
82 if zoomclient
and options
.swap
then
83 curframe
:attach(zoomclient
)
85 if zoomclient
and options
.goto
then
86 zoomclient
:goto() -- make it activated in the frame
88 if curclient
and options
.goto
then