wibox: add wibox_need_update()
This moves some common code into the new function wibox_need_update(). This patch is based on a patch from Julien Danjou. Signed-off-by: Uli Schlachter <psychon@znc.in> Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
d441254412
commit
62397eac95
21
wibox.c
21
wibox.c
|
@ -34,6 +34,13 @@ DO_LUA_NEW(extern, wibox_t, wibox, "wibox", wibox_ref)
|
||||||
DO_LUA_GC(wibox_t, wibox, "wibox", wibox_unref)
|
DO_LUA_GC(wibox_t, wibox, "wibox", wibox_unref)
|
||||||
DO_LUA_EQ(wibox_t, wibox, "wibox")
|
DO_LUA_EQ(wibox_t, wibox, "wibox")
|
||||||
|
|
||||||
|
static void
|
||||||
|
wibox_need_update(wibox_t *wibox)
|
||||||
|
{
|
||||||
|
wibox->need_update = true;
|
||||||
|
wibox->mouse_over = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wibox_move(wibox_t *wibox, int16_t x, int16_t y)
|
wibox_move(wibox_t *wibox, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
|
@ -59,8 +66,7 @@ wibox_resize(wibox_t *wibox, uint16_t width, uint16_t height)
|
||||||
wibox->sw.geometry.width = width;
|
wibox->sw.geometry.width = width;
|
||||||
wibox->sw.geometry.height = height;
|
wibox->sw.geometry.height = height;
|
||||||
}
|
}
|
||||||
wibox->need_update = true;
|
wibox_need_update(wibox);
|
||||||
wibox->mouse_over = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -96,8 +102,7 @@ wibox_setposition(wibox_t *wibox, position_t p)
|
||||||
|
|
||||||
ewmh_update_workarea(screen_virttophys(wibox->screen));
|
ewmh_update_workarea(screen_virttophys(wibox->screen));
|
||||||
|
|
||||||
wibox->need_update = true;
|
wibox_need_update(wibox);
|
||||||
wibox->mouse_over = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -662,7 +667,7 @@ wibox_attach(wibox_t *wibox, screen_t *s)
|
||||||
client_stack();
|
client_stack();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
wibox->need_update = true;
|
wibox_need_update(wibox);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Create a new wibox.
|
/** Create a new wibox.
|
||||||
|
@ -753,8 +758,7 @@ wibox_widgets_table_build(lua_State *L, wibox_t *wibox)
|
||||||
widget_node_array_wipe(&wibox->widgets);
|
widget_node_array_wipe(&wibox->widgets);
|
||||||
widget_node_array_init(&wibox->widgets);
|
widget_node_array_init(&wibox->widgets);
|
||||||
luaA_table2widgets(L, &wibox->widgets);
|
luaA_table2widgets(L, &wibox->widgets);
|
||||||
wibox->mouse_over = NULL;
|
wibox_need_update(wibox);
|
||||||
wibox->need_update = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if a wibox widget table has an item.
|
/** Check if a wibox widget table has an item.
|
||||||
|
@ -1076,8 +1080,7 @@ luaA_wibox_newindex(lua_State *L)
|
||||||
if((buf = luaL_checklstring(L, 3, &len)))
|
if((buf = luaL_checklstring(L, 3, &len)))
|
||||||
{
|
{
|
||||||
simplewindow_orientation_set(&(*wibox)->sw, orientation_fromstr(buf, len));
|
simplewindow_orientation_set(&(*wibox)->sw, orientation_fromstr(buf, len));
|
||||||
(*wibox)->need_update = true;
|
wibox_need_update(*wibox);
|
||||||
(*wibox)->mouse_over = NULL;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case A_TK_BORDER_COLOR:
|
case A_TK_BORDER_COLOR:
|
||||||
|
|
Loading…
Reference in New Issue