gears.surface: Add a version check for lgi

The cairo bindings are quite new in lgi and thus we depend on a quite new
version of lgi. Older versions will fail with lots of weird errors, e.g.:

lib/gears/color.lua:61:attempt to call field 'create_rgba' (a nil value)

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2012-06-05 16:22:04 +02:00
parent ab7788e2f5
commit ca2fc7811a

View file

@ -9,6 +9,10 @@ local type = type
local capi = { awesome = awesome } local capi = { awesome = awesome }
local cairo = require("lgi").cairo local cairo = require("lgi").cairo
if tonumber(require("lgi.version")) <= 0.5 then
error("lgi too old, need at least version 0.7 (not yet released?) or recent git")
end
module("gears.surface") module("gears.surface")
--- Try to convert the argument into an lgi cairo surface. --- Try to convert the argument into an lgi cairo surface.