diff options
Diffstat (limited to 'scratchpad.lua')
-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 |