From 2f6858d946d3c7190dad2e4d37971902d4e584ca Mon Sep 17 00:00:00 2001 From: Quan Guo Date: Fri, 25 Sep 2015 02:58:34 +0200 Subject: [PATCH] Update master branch to work with all verions of awesome WM --- README.md | 6 ++++-- init.lua | 16 +++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 11f4cd9..649de68 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,11 @@ It is modified from the original revelation.lua for incorperating with awesome 3 It also have some features. -**Master branch is only working with awesome master branch.** +**Now master branch works for both master and stable awesome WM** -**For current stable version of awesome, 3.5.6, please checkout stable version** +~~Master branch is only working with awesome master branch.~~ + +~~For current stable version of awesome, 3.5.6, please checkout stable version~~ ## Changes since 2014-02-19 ## Changes since 2014-02-19 diff --git a/init.lua b/init.lua index f23e72f..b0d1e5d 100644 --- a/init.lua +++ b/init.lua @@ -29,8 +29,8 @@ local capi = { mouse = mouse, screen = screen } --- the function is still in develop version ---local delayed_call = require("gears.timer").delayed_call + +local delayed_call = (type(timer) ~= 'table' and require("gears.timer").delayed_call) local clientData = {} -- table that holds the positions and sizes of floating clients @@ -65,7 +65,7 @@ local revelation = { curr_tag_only = false, font = "monospace 20", fg = beautiful.fg_normal, - hintsize = beautiful.xresources.apply_dpi(50) + hintsize = (type(beautiful.xresources) == 'table' and beautiful.xresources.apply_dpi(50) or 60) } @@ -153,8 +153,14 @@ function revelation.expose(args) awful.tag.viewonly(t[scr], t.screen) end - capi.awesome.emit_signal("refresh") - revelation.expose_callback(t, zt) + + if type(delayed_call) == 'function' then + delayed_call(function () revelation.expose_callback(t, zt) end ) + else + revelation.expose_callback(t, zt) + -- No need for awesome WM 3.5.6 + --capi.awesome.emit_signal("refresh") + end end