From dc4087fcff0739971854645cf599806678cbfcdd Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sun, 12 Jul 2009 12:28:22 +0200 Subject: [PATCH] Ugly workaround for segfaults when build with x11 and lua --- src/llua.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/llua.c b/src/llua.c index b23f471d..e8f43253 100644 --- a/src/llua.c +++ b/src/llua.c @@ -428,9 +428,11 @@ void llua_setup_window_table(int text_start_x, int text_start_y, int text_width, { lua_newtable(lua_L); +/* TODO fix this: (segfaults) llua_set_userdata("drawable", "Drawable", (void*)&window.drawable); llua_set_userdata("visual", "Visual", window.visual); llua_set_userdata("display", "Display", display); +*/ llua_set_long("width", window.width); llua_set_long("height", window.height); @@ -448,6 +450,7 @@ void llua_setup_window_table(int text_start_x, int text_start_y, int text_width, void llua_update_window_table(int text_start_x, int text_start_y, int text_width, int text_height) { + llua_init(); //needed because sometimes lua isn't initialised resulting in segfaults lua_getglobal(lua_L, "conky_window"); if (lua_isnil(lua_L, -1)) { /* window table isn't populated yet */