From 506a4200c69e652214c5c2f1438fdf3952c846d0 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 3 Sep 2008 16:51:46 +0200 Subject: [PATCH] client: support input focus hints Signed-off-by: Julien Danjou --- client.c | 4 +++- structs.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index a9557807..74512472 100644 --- a/client.c +++ b/client.c @@ -252,7 +252,7 @@ client_ban(client_t *c) static void client_focus(client_t *c) { - if(!client_maybevisible(c, c->screen)) + if(!client_maybevisible(c, c->screen) || c->nofocus) return; /* unfocus current selected client */ @@ -855,6 +855,8 @@ client_updatewmhints(client_t *c) if((wmh.flags & XCB_WM_HINT_STATE) && wmh.initial_state == XCB_WM_STATE_WITHDRAWN) client_setborder(c, 0); + + c->nofocus = !wmh.input; } } diff --git a/structs.h b/structs.h index ee0d5145..7c2a0f5b 100644 --- a/structs.h +++ b/structs.h @@ -306,6 +306,8 @@ struct client_t bool isontop; /** true if the client must be skipped from task bar client list */ bool skiptb; + /** True if the client cannot have focus */ + bool nofocus; /** The window type */ window_type_t type; /** Window of the client */