client: allow selection of nofocus windows

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Mariusz Ceier 2009-01-02 11:21:34 +01:00 committed by Julien Danjou
parent 2a882803ec
commit 2e345fbcda
1 changed files with 7 additions and 5 deletions

View File

@ -187,6 +187,7 @@ client_unfocus(client_t *c)
globalconf.screens[c->phys_screen].client_focus = NULL; globalconf.screens[c->phys_screen].client_focus = NULL;
/* Set focus on root window, so no events leak to the current window. */ /* Set focus on root window, so no events leak to the current window. */
if (!c->nofocus)
xcb_set_input_focus(globalconf.connection, XCB_INPUT_FOCUS_POINTER_ROOT, xcb_set_input_focus(globalconf.connection, XCB_INPUT_FOCUS_POINTER_ROOT,
root_win, XCB_CURRENT_TIME); root_win, XCB_CURRENT_TIME);
@ -252,7 +253,7 @@ client_ban(client_t *c)
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))
return; return;
/* unfocus current selected client */ /* unfocus current selected client */
@ -270,6 +271,7 @@ client_focus(client_t *c)
globalconf.screen_focus = &globalconf.screens[c->phys_screen]; globalconf.screen_focus = &globalconf.screens[c->phys_screen];
globalconf.screen_focus->client_focus = c; globalconf.screen_focus->client_focus = c;
if (!c->nofocus)
xcb_set_input_focus(globalconf.connection, XCB_INPUT_FOCUS_POINTER_ROOT, xcb_set_input_focus(globalconf.connection, XCB_INPUT_FOCUS_POINTER_ROOT,
c->win, XCB_CURRENT_TIME); c->win, XCB_CURRENT_TIME);