ewmh: add suport for _NET_ACTIVE_WINDOW message

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Arnaud VALLAT 2008-12-15 10:04:46 +01:00 committed by Julien Danjou
parent a1489b867b
commit ba6f5e42bb
3 changed files with 7 additions and 1 deletions

View File

@ -213,7 +213,7 @@ client_ban(client_t *c)
* \param c The client or NULL. * \param c The client or NULL.
* \return True if a window (even root) has received focus, false otherwise. * \return True if a window (even root) has received focus, false otherwise.
*/ */
static void void
client_focus(client_t *c) client_focus(client_t *c)
{ {
if(!client_maybevisible(c, c->screen) || c->nofocus) if(!client_maybevisible(c, c->screen) || c->nofocus)

View File

@ -66,6 +66,7 @@ void client_setmaxhoriz(client_t *, bool);
void client_setmaxvert(client_t *, bool); void client_setmaxvert(client_t *, bool);
void client_setminimized(client_t *, bool); void client_setminimized(client_t *, bool);
void client_setborder(client_t *, int); void client_setborder(client_t *, int);
void client_focus(client_t *);
int luaA_client_newindex(lua_State *); int luaA_client_newindex(lua_State *);

5
ewmh.c
View File

@ -403,6 +403,11 @@ ewmh_process_client_message(xcb_client_message_event_t *ev)
ev->data.data32[0]); ev->data.data32[0]);
} }
} }
else if(ev->type == _NET_ACTIVE_WINDOW)
{
if((c = client_getbywin(ev->window)))
client_focus(c);
}
return 0; return 0;
} }