File: mp.lua

package info (click to toggle)
notion 3%2B2012042300-1
  • links: PTS, VCS
  • area: non-free
  • in suites: wheezy
  • size: 4,724 kB
  • sloc: ansic: 45,614; makefile: 544; sh: 409; perl: 113
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