wibox: add struts

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-18 14:23:41 +02:00
parent b249c67af9
commit 53ac109baa
2 changed files with 23 additions and 0 deletions

20
wibox.c
View File

@ -28,6 +28,7 @@
#include "screen.h"
#include "window.h"
#include "luaa.h"
#include "ewmh.h"
#include "common/xcursor.h"
#include "common/xutil.h"
@ -767,6 +768,8 @@ wibox_attach(lua_State *L, int udx, screen_t *s)
if(wibox->opacity != -1)
window_opacity_set(wibox->window, wibox->opacity);
ewmh_update_strut(wibox->window, &wibox->strut);
if(wibox->visible)
wibox_map(wibox);
else
@ -907,6 +910,22 @@ luaA_wibox_geometry(lua_State *L)
return luaA_pusharea(L, wibox->geometry);
}
static int
luaA_wibox_struts(lua_State *L)
{
wibox_t *w = luaA_checkudata(L, 1, &wibox_class);
if(lua_gettop(L) == 2)
{
luaA_tostrut(L, 2, &w->strut);
if(w->window)
ewmh_update_strut(w->window, &w->strut);
luaA_object_emit_signal(L, 1, "property::struts", 0);
}
return luaA_pushstrut(L, w->strut);
}
LUA_OBJECT_EXPORT_PROPERTY(wibox, wibox_t, ontop, lua_pushboolean)
LUA_OBJECT_EXPORT_PROPERTY(wibox, wibox_t, cursor, lua_pushstring)
LUA_OBJECT_EXPORT_PROPERTY(wibox, wibox_t, visible, lua_pushboolean)
@ -1476,6 +1495,7 @@ wibox_class_setup(lua_State *L)
{
LUA_OBJECT_META(wibox)
LUA_CLASS_META
{ "struts", luaA_wibox_struts },
{ "buttons", luaA_wibox_buttons },
{ "geometry", luaA_wibox_geometry },
{ "__gc", luaA_wibox_gc },

View File

@ -23,6 +23,7 @@
#define AWESOME_WIBOX_H
#include "widget.h"
#include "strut.h"
#include "common/luaobject.h"
/** Wibox types */
@ -83,6 +84,8 @@ struct wibox_t
orientation_t orientation;
/** Opacity */
double opacity;
/** Strut */
strut_t strut;
/** The window's shape */
struct
{