diff --git a/client.c b/client.c index a95578071..74512472c 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 ee0d51457..7c2a0f5b6 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 */