From bcab5c71a759b934219bfe08b7d65340112a9166 Mon Sep 17 00:00:00 2001 From: Hisham Date: Thu, 15 Sep 2016 11:21:49 -0300 Subject: [PATCH] Compatibility tweak for minimize and 3.5 themes Awesome 3.5.9 accepts `_active`/`_inactive` names for `beautiful` minimize keys (such as "titlebar_minimize_button_focus_inactive"). Some themes rely on those, meaning that when they loaded under the current Git, the minimize button went missing. This adds a fallback, to improve compatibility with the existing themes. --- lib/awful/titlebar.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/awful/titlebar.lua b/lib/awful/titlebar.lua index 13bcc272..fa4df5de 100644 --- a/lib/awful/titlebar.lua +++ b/lib/awful/titlebar.lua @@ -226,7 +226,6 @@ function titlebar.widget.button(c, name, selector, action) img = "inactive" end end - -- First try with a prefix based on the client's focus state local prefix = "normal" if capi.client.focus == c then prefix = "focus" @@ -234,11 +233,12 @@ function titlebar.widget.button(c, name, selector, action) if img ~= "" then prefix = prefix .. "_" end + -- First try with a prefix based on the client's focus state, + -- then try again without that prefix if nothing was found, + -- and finally, try a fallback for compatibility with Awesome 3.5 themes local theme = beautiful["titlebar_" .. name .. "_button_" .. prefix .. img] - if not theme then - -- Then try again without that prefix if nothing was found - theme = beautiful["titlebar_" .. name .. "_button_" .. img] - end + or beautiful["titlebar_" .. name .. "_button_" .. img] + or beautiful["titlebar_" .. name .. "_button_" .. prefix .. "_inactive"] if theme then img = theme end