From 18e9bfbcfa407df1a3c035a38272b80cc9e819c8 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Tue, 14 Jul 2015 01:39:03 -0400 Subject: [PATCH] client: Do not assume the wfact exist Since the call can now be delayed, "windowfact" may not exist yet. Regression from 74106462ac1f0877d4dd3791c9a983283c034169 --- lib/awful/client.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/awful/client.lua b/lib/awful/client.lua index cbae3cb6..d4bfa356 100644 --- a/lib/awful/client.lua +++ b/lib/awful/client.lua @@ -831,7 +831,19 @@ function client.setwfact(wfact, c) local data = tag.getproperty(t, "windowfact") or {} local colfact = data[w.col] + local need_normalize = colfact ~= nil + + if not need_normalize then + colfact = {} + end + colfact[w.idx] = wfact + + if not need_normalize then + t:emit_signal("property::windowfact") + return + end + local rest = 1-wfact -- calculate the current denominator @@ -866,7 +878,7 @@ function client.incwfact(add, c) local nmaster = tag.getnmaster(t) local data = tag.getproperty(t, "windowfact") or {} - local colfact = data[w.col] + local colfact = data[w.col] or {} curr = colfact[w.idx] or 1 colfact[w.idx] = curr + add