From 022879e8be0d476d108ebfcf1c72288609d18eaf Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 2 Sep 2008 14:03:11 +0200 Subject: [PATCH] textbox: reinit draw parser data Signed-off-by: Julien Danjou --- widgets/textbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/widgets/textbox.c b/widgets/textbox.c index c81c8b5f..2d9435f0 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -146,6 +146,8 @@ luaA_textbox_newindex(lua_State *L, awesome_token_t token) { /* delete */ 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); /* re-init */ @@ -153,7 +155,6 @@ luaA_textbox_newindex(lua_State *L, awesome_token_t token) if(buf) { a_iso2utf8(&d->text, buf, len); - draw_parser_data_init(&d->pdata); d->extents = draw_text_extents(globalconf.connection, globalconf.default_screen, globalconf.font, d->text, d->len, &d->pdata).width; }