diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-09-18 13:01:16 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-09-18 13:01:16 +0200 |
commit | 4a5b4e34a44e66ac4486495646ac97e6be8508e3 (patch) | |
tree | 54a35f6f51466a1b8d3cfd98d1523f52ad50828d | |
parent | d87074446507255ad6c589b1044bdce382604cb1 (diff) | |
download | awesome-configs-4a5b4e34a44e66ac4486495646ac97e6be8508e3.tar.xz |
scratchpad: added unmanage signal
This solves problems in situations where client is killed. Then the
stored client becomes invalid. Now table is cleared.
-rw-r--r-- | scratchpad.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scratchpad.lua b/scratchpad.lua index 685dfdc..3106b14 100644 --- a/scratchpad.lua +++ b/scratchpad.lua @@ -72,8 +72,16 @@ function set(c, width, height, sticky, screen) capi.client.focus = c end - -- Prepare a table for storing clients - if not scratch["pad"] then scratch["pad"] = {} end + -- Prepare a table for storing clients, + if not scratch["pad"] then scratch["pad"] = {} + -- add unmanage signal for scratchpad clients + capi.client.add_signal("unmanage", function (c) + local oc = scratch["pad"][screen] + if oc == c then + scratch["pad"][screen] = nil + end + end) + end -- If the scratcphad is emtpy, store the client, if not scratch["pad"][screen] then |