From 40958f9d21dcf3e3479408a8cae56a53a7112264 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 21 Jan 2011 19:54:27 +0100 Subject: [PATCH] Use ._NAME for identifying oocairo surfaces image:type() was removed from oocairo, because the ._NAME property already exists and there's no need for two functions doing the same job. Signed-off-by: Uli Schlachter --- lib/awful/widget/button.lua.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/awful/widget/button.lua.in b/lib/awful/widget/button.lua.in index c81f2132b..4f84baff3 100644 --- a/lib/awful/widget/button.lua.in +++ b/lib/awful/widget/button.lua.in @@ -24,6 +24,8 @@ function new(args) img_release = capi.oocairo.image_surface_create_from_png(args.image) elseif type(args.image) == "userdata" and args.image.type and args.image:type() == "cairo_surface_t" then img_release = args.image + elseif type(args.image) == "userdata" and args.image._NAME and args.image._NAME == "cairo surface object" then + img_release = args.image end local img_press = capi.oocairo.image_surface_create("argb32", img_release:get_width(), img_release:get_height()) local cr = capi.oocairo.context_create(img_press)