From 40c208a42220fd3e317755ce8c35227d37efde4c Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Mon, 1 Dec 2008 19:06:35 +0100 Subject: [PATCH] client: Expose group windows. Signed-off-by: Maarten Maathuis Signed-off-by: Julien Danjou --- client.c | 7 +++++++ common/tokenize.gperf | 1 + property.c | 3 +++ structs.h | 2 ++ 4 files changed, 13 insertions(+) diff --git a/client.c b/client.c index fc9f59cbb..5a6231abf 100644 --- a/client.c +++ b/client.c @@ -1477,6 +1477,7 @@ luaA_client_newindex(lua_State *L) * \lfield maximized_horizontal The client is maximized horizontally or not. * \lfield maximized_vertical The client is maximized vertically or not. * \lfield transient_for Return the client the window is transient for. + * \lfield group_id Identification unique to a group of windows. * \lfield size_hints A table with size hints of the client: user_position, * user_size, program_position and program_size. */ @@ -1600,6 +1601,12 @@ luaA_client_index(lua_State *L) case A_TK_FULLSCREEN: lua_pushboolean(L, (*c)->isfullscreen); break; + case A_TK_GROUP_ID: + if((*c)->group_win) + lua_pushnumber(L, (*c)->group_win); + else + return 0; + break; case A_TK_MAXIMIZED_HORIZONTAL: lua_pushboolean(L, (*c)->ismaxhoriz); break; diff --git a/common/tokenize.gperf b/common/tokenize.gperf index c47bbf61e..cb7a362a6 100644 --- a/common/tokenize.gperf +++ b/common/tokenize.gperf @@ -28,6 +28,7 @@ font fullscreen gap geometry +group_id grow height hide diff --git a/property.c b/property.c index a646a3956..b641a8b37 100644 --- a/property.c +++ b/property.c @@ -192,6 +192,9 @@ property_update_wm_hints(client_t *c, xcb_get_property_reply_t *reply) if(wmh.flags & XCB_WM_HINT_INPUT) c->nofocus = !wmh.input; + + if(wmh.flags & XCB_WM_HINT_WINDOW_GROUP) + c->group_win = wmh.window_group; } static int diff --git a/structs.h b/structs.h index cb6dbe217..b61d5c7e9 100644 --- a/structs.h +++ b/structs.h @@ -203,6 +203,8 @@ struct client_t window_type_t type; /** Window of the client */ xcb_window_t win; + /** Window of the group leader */ + xcb_window_t group_win; /** Client logical screen */ int screen; /** Client physical screen */