From ba6f5e42bbce1c799ce8fae6d623a6a182f781c0 Mon Sep 17 00:00:00 2001 From: Arnaud VALLAT Date: Mon, 15 Dec 2008 10:04:46 +0100 Subject: [PATCH] ewmh: add suport for _NET_ACTIVE_WINDOW message Signed-off-by: Julien Danjou --- client.c | 2 +- client.h | 1 + ewmh.c | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 26d6636d..eacd29ae 100644 --- a/client.c +++ b/client.c @@ -213,7 +213,7 @@ client_ban(client_t *c) * \param c The client or NULL. * \return True if a window (even root) has received focus, false otherwise. */ -static void +void client_focus(client_t *c) { if(!client_maybevisible(c, c->screen) || c->nofocus) diff --git a/client.h b/client.h index ec210782..69740eea 100644 --- a/client.h +++ b/client.h @@ -66,6 +66,7 @@ void client_setmaxhoriz(client_t *, bool); void client_setmaxvert(client_t *, bool); void client_setminimized(client_t *, bool); void client_setborder(client_t *, int); +void client_focus(client_t *); int luaA_client_newindex(lua_State *); diff --git a/ewmh.c b/ewmh.c index 2eabdae5..933329ce 100644 --- a/ewmh.c +++ b/ewmh.c @@ -403,6 +403,11 @@ ewmh_process_client_message(xcb_client_message_event_t *ev) ev->data.data32[0]); } } + else if(ev->type == _NET_ACTIVE_WINDOW) + { + if((c = client_getbywin(ev->window))) + client_focus(c); + } return 0; }