From df23964b20926e63a128e1e507932c3e33c513d8 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 1 Apr 2014 10:48:18 +0200 Subject: [PATCH] Make callbacks to rules.execute optional --- lib/awful/rules.lua.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/awful/rules.lua.in b/lib/awful/rules.lua.in index 32d84a4d1..bf90d5b4c 100644 --- a/lib/awful/rules.lua.in +++ b/lib/awful/rules.lua.in @@ -197,7 +197,7 @@ end --- Apply properties and callbacks to a client. -- @param c The client. -- @param props Properties to apply. --- @param callbacks Callbacks to apply. +-- @param callbacks Callbacks to apply (optional). function rules.execute(c, props, callbacks) for property, value in pairs(props) do if property ~= "focus" and type(value) == "function" then @@ -230,8 +230,10 @@ function rules.execute(c, props, callbacks) end -- Apply all callbacks. - for i, callback in pairs(callbacks) do - callback(c) + if callbacks then + for i, callback in pairs(callbacks) do + callback(c) + end end -- Do this at last so we do not erase things done by the focus