Expose XWarpPointer to lua as rootwin:warp_pointer, for region_do_warp_alt
[notion.git] / contrib / scripts / collapse.lua
bloba533376495a28d03e12b9dfc0490daface6d9962
1 -- Authors: Unknown
2 -- License: Unknown
3 -- Last Changed: Unknown
4 --
5 -- Move all windows on a WTiling to a single frame and destroy the rest.
6 -- (like C-x 1 in Emacs)
7 -- This is the ion3 version.
9 collapse={}
11 function collapse.take_frame_to_here (region, current)
12 if region ~= current then
13 region:managed_i(function (cwin)
14 ioncore.defer(function ()
15 current:attach(cwin)
16 end)
17 return true
18 end)
19 ioncore.defer(function ()
20 region:rqclose()
21 end)
22 end
23 return true
24 end
26 function collapse.collapse(ws)
27 local current = ws:current()
28 ws:managed_i (function (region)
29 return collapse.take_frame_to_here(region, current)
30 end)
31 current:goto()
32 end