From f3e12dbe5213e46c8f10d5b0c1c828c38275b427 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 13 Jul 2009 15:36:49 +0200 Subject: [PATCH] screen: add .index property Signed-off-by: Julien Danjou --- common/tokenize.gperf | 1 + screen.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/common/tokenize.gperf b/common/tokenize.gperf index dd284948..04bdcb92 100644 --- a/common/tokenize.gperf +++ b/common/tokenize.gperf @@ -46,6 +46,7 @@ icon_name id image imagebox +index instance key key_press diff --git a/screen.c b/screen.c index 3ce2ac08..1ca78717 100644 --- a/screen.c +++ b/screen.c @@ -431,6 +431,9 @@ luaA_screen_index(lua_State *L) switch(a_tokenize(buf, len)) { + case A_TK_INDEX: + lua_pushinteger(L, screen_array_indexof(&globalconf.screens, s) + 1); + break; case A_TK_GEOMETRY: luaA_pusharea(L, s->geometry); break;