From cb11fee2fa0f4cf8b272f46559f8c05e916ba1ca Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Tue, 14 Dec 2010 07:41:13 +0100 Subject: scratch: fixed pad multiple screen support Unmanage handler was deleting the wrong client for the scratch table. Causing lua tracebacks and breaking awesome on next scratch.pad call. Now proper scratched clients are zeroed in multi display setups. --- scratch/pad.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scratch') diff --git a/scratch/pad.lua b/scratch/pad.lua index cdf87e0..920d1d6 100644 --- a/scratch/pad.lua +++ b/scratch/pad.lua @@ -24,6 +24,7 @@ --------------------------------------------------------------- -- Grab environment +local pairs = pairs local awful = require("awful") local capi = { mouse = mouse, @@ -79,8 +80,8 @@ function set(c, width, height, sticky, screen) if not scratchpad.pad then scratchpad.pad = {} -- add unmanage signal for scratchpad clients capi.client.add_signal("unmanage", function (c) - if scratchpad.pad[screen] == c then - scratchpad.pad[screen] = nil + for scr, cl in pairs(scratchpad.pad) do + if cl == c then scratchpad.pad[scr] = nil end end end) end -- cgit v1.2.3