1 -- Authors: Rene van Bevern <rvb@pro-linux.de>, Etan Reisner <deryni@gmail.com>
2 -- License: Public domain
3 -- Last Changed: Unknown
7 -- exchanges current client window with the active client window of the frame
8 -- called 'zoomframe' -- resembling the behavior of larswm
10 -- +---------------------------------------------------+-----------------+
17 -- | Z o o m f r a m e w i t h +-----------------+
18 -- | z o o m e d C l i e nt | |
24 -- +--------------------------------+------------------+-----------------+
27 -- | Client 4 | Client 3 |
30 -- +--------------------------------+------------------------------------+
32 -- Example: zoom_client on "Client 2" will put "Client 2" into the zoom frame
33 -- and "zoomed Client" into the frame of "Client 2"
35 -- By Rene van Bevern <rvb@pro-linux.de>, 2005
36 -- Modifications by Etan Reisner <deryni in #ion>
39 -- Example keybindings:
41 -- defbindings("WFrame", {
42 -- kpress(META.."z", "zoom_client(_, _sub)")
43 -- kpress(META.."z", "zoom_client(_, _sub, {swap=true})")
44 -- kpress(META.."z", "zoom_client(_, _sub, {swap=false, goto=true})")
47 -- zoom_client accepts a table that may contain the options 'swap'
48 -- and 'goto'. Both are by default set to 'true'.
50 -- 'goto' controls whether to switch to the zoomframe
52 -- 'swap' controls whether to bring the zoomframe's active client
53 -- into the current frame
56 -- Example configuration setup:
58 -- zoom_client_set({zoomframename = 'foo'})
61 zoomframename
= 'zoomframe'
64 function zoom_client_set(tab
)
65 settings
= table.join(tab
, settings
)
68 function zoom_client(curframe
, curclient
, options
)
69 local zoomframe
= ioncore
.lookup_region(settings
.zoomframename
, 'WFrame')
70 if options
== nil then
73 if options
.goto
== nil then
76 if options
.swap
== nil then
79 if (not zoomframe
) or (curframe
== zoomframe
) then
82 local zoomclient
= zoomframe
:mx_current()
84 zoomframe
:attach(curclient
)
86 if zoomclient
and options
.swap
then
87 curframe
:attach(zoomclient
)
89 if zoomclient
and options
.goto
then
90 zoomclient
:goto() -- make it activated in the frame
92 if curclient
and options
.goto
then