textbox: reinit draw parser data

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-09-02 14:03:11 +02:00
parent 7b00a2baf0
commit 022879e8be
1 changed files with 2 additions and 1 deletions

View File

@ -146,6 +146,8 @@ luaA_textbox_newindex(lua_State *L, awesome_token_t token)
{ {
/* delete */ /* delete */
draw_parser_data_wipe(&d->pdata); draw_parser_data_wipe(&d->pdata);
/* reinit since we are giving it as arg to draw_text unconditionally */
draw_parser_data_init(&d->pdata);
p_delete(&d->text); p_delete(&d->text);
/* re-init */ /* re-init */
@ -153,7 +155,6 @@ luaA_textbox_newindex(lua_State *L, awesome_token_t token)
if(buf) if(buf)
{ {
a_iso2utf8(&d->text, buf, len); a_iso2utf8(&d->text, buf, len);
draw_parser_data_init(&d->pdata);
d->extents = draw_text_extents(globalconf.connection, globalconf.default_screen, d->extents = draw_text_extents(globalconf.connection, globalconf.default_screen,
globalconf.font, d->text, d->len, &d->pdata).width; globalconf.font, d->text, d->len, &d->pdata).width;
} }