titlebar: use client_getbytitlebar() to get client
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
694f97e4d7
commit
2a027ef2a9
|
@ -344,7 +344,6 @@ luaA_titlebar_widget_add(lua_State *L)
|
||||||
titlebar_t **tb = luaA_checkudata(L, 1, "titlebar");
|
titlebar_t **tb = luaA_checkudata(L, 1, "titlebar");
|
||||||
widget_t **widget = luaA_checkudata(L, 2, "widget");
|
widget_t **widget = luaA_checkudata(L, 2, "widget");
|
||||||
widget_node_t *witer, *w = p_new(widget_node_t, 1);
|
widget_node_t *witer, *w = p_new(widget_node_t, 1);
|
||||||
client_t *c;
|
|
||||||
|
|
||||||
if((*widget)->type == systray_new)
|
if((*widget)->type == systray_new)
|
||||||
luaL_error(L, "cannot add systray widget to titlebar");
|
luaL_error(L, "cannot add systray widget to titlebar");
|
||||||
|
@ -360,12 +359,7 @@ luaA_titlebar_widget_add(lua_State *L)
|
||||||
widget_node_list_append(&(*tb)->widgets, w);
|
widget_node_list_append(&(*tb)->widgets, w);
|
||||||
widget_ref(widget);
|
widget_ref(widget);
|
||||||
|
|
||||||
for(c = globalconf.clients; c; c = c->next)
|
titlebar_draw(client_getbytitlebar(*tb));
|
||||||
if(c->titlebar == *tb)
|
|
||||||
{
|
|
||||||
titlebar_draw(c);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue