File: mp.lua

package info (click to toggle)
ion3-scripts 20050418-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 300 kB
  • ctags: 153
  • sloc: makefile: 18
file content (30 lines) | stat: -rw-r--r-- 546 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- Mark next mapped window to be attached to a specified object

local marked

function mark_for_attach(frame)
    marked=frame
end

local function copy(t)
    local ct={}
    for k, v in t do
         ct[k]=v
    end
    return ct
end

local orig_get_winprop=get_winprop

local function marked_get_winprop(cwin)
    local props=orig_get_winprop(cwin)
    if not marked then
        return props
    end
    local newprops=copy(props or {})
    newprops.target=marked:name()
    marked=nil
    return newprops
end

get_winprop=marked_get_winprop