wibox: add struts
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
b249c67af9
commit
53ac109baa
20
wibox.c
20
wibox.c
|
@ -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 },
|
||||
|
|
3
wibox.h
3
wibox.h
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue