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
1 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,10 @@ local type = type
local capi = { awesome = awesome }
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")
--- Try to convert the argument into an lgi cairo surface.