From 240a83d215dcb22daf8f3d491efb219f24d82f9d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 9 Nov 2009 21:27:00 +0100 Subject: [PATCH] widget: fix screen number of layouts as arg Signed-off-by: Julien Danjou --- widget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widget.c b/widget.c index 74f8ae8c1..4c0d293c8 100644 --- a/widget.c +++ b/widget.c @@ -175,7 +175,7 @@ widget_geometries(wibox_t *wibox) luaA_object_push_item(globalconf.L, -1, wibox->widgets_table); lua_remove(globalconf.L, -2); /* Push 3rd argument: wibox screen */ - lua_pushnumber(globalconf.L, screen_array_indexof(&globalconf.screens, wibox->screen)); + lua_pushnumber(globalconf.L, screen_array_indexof(&globalconf.screens, wibox->screen) + 1); /* Re-push the layout function */ lua_pushvalue(globalconf.L, -4); /* call the layout function with 3 arguments (wibox geometry, widget @@ -214,7 +214,7 @@ widget_geometries(wibox_t *wibox) { lua_pushnumber(globalconf.L, i + 1); widget_t *widget = widgets->tab[i].widget; - lua_pushnumber(globalconf.L, screen_array_indexof(&globalconf.screens, wibox->screen)); + lua_pushnumber(globalconf.L, screen_array_indexof(&globalconf.screens, wibox->screen) + 1); area_t geometry = widget->extents(globalconf.L, widget); lua_pop(globalconf.L, 1); geometry.x = geometry.y = 0;