From ca2fc7811ad769cc88ead583e099230f33f6c8a2 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 5 Jun 2012 16:22:04 +0200 Subject: [PATCH] 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 --- lib/gears/surface.lua.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/gears/surface.lua.in b/lib/gears/surface.lua.in index df38db810..26d004a39 100644 --- a/lib/gears/surface.lua.in +++ b/lib/gears/surface.lua.in @@ -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.