From 542312beffd80ff4228ea50523f18747a587bc82 Mon Sep 17 00:00:00 2001 From: Gregor Best Date: Sat, 24 Jan 2009 23:48:05 +0100 Subject: [PATCH] wibox.c: add real transparency for wiboxes Signed-off-by: Gregor Best Signed-off-by: Julien Danjou --- wibox.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wibox.c b/wibox.c index 7c01d7d7..3f77ca4e 100644 --- a/wibox.c +++ b/wibox.c @@ -26,6 +26,7 @@ #include "ewmh.h" #include "screen.h" #include "common/xcursor.h" +#include "window.h" extern awesome_t globalconf; @@ -873,6 +874,15 @@ luaA_wibox_index(lua_State *L) case A_TK_CURSOR: lua_pushstring(L, (*wibox)->cursor); break; + case A_TK_OPACITY: + { + double d; + if ((d = window_opacity_get((*wibox)->sw.window)) >= 0) + lua_pushnumber(L, d); + else + return 0; + } + break; default: return 0; } @@ -1059,6 +1069,16 @@ luaA_wibox_newindex(lua_State *L) wibox_widgets_table_build(L, *wibox); luaA_table2wtable(L); break; + case A_TK_OPACITY: + if(lua_isnil(L, 3)) + window_opacity_set((*wibox)->sw.window, -1); + else + { + double d = luaL_checknumber(L, 3); + if(d >= 0 && d <= 1) + window_opacity_set((*wibox)->sw.window, d); + } + break; default: switch((*wibox)->type) {