From c9a6f6f9942aee9766db3f647b04a161994314bb Mon Sep 17 00:00:00 2001 From: zsugabubus Date: Wed, 24 Apr 2019 03:12:03 +0000 Subject: [PATCH] keygrabber: Fix optional "release" handling (#2756) Even thought `awful.key` handles optional "release" parameter well, parameters are also get used before passing them. In case (only) optional "data" is provided, it faulty gets called on a release event. --- lib/awful/keygrabber.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/awful/keygrabber.lua b/lib/awful/keygrabber.lua index 617b8cade..277570342 100644 --- a/lib/awful/keygrabber.lua +++ b/lib/awful/keygrabber.lua @@ -141,7 +141,12 @@ local function add_root_keybindings(self, list) local obj_self, obj_list = obj[1], obj[2] for _, v in ipairs(obj_list) do - local mods, key, press, release, description = unpack(v) + local mods, key, press, release, data = unpack(v) + + if type(release) == 'table' then + data = release + release = nil + end if press then local old_press = press @@ -159,7 +164,7 @@ local function add_root_keybindings(self, list) end end - table.insert(ret, akey(mods, key, press, release, description)) + table.insert(ret, akey(mods, key, press, release, data)) end end