From 63e4ba460b97e25e849ec3211c6ccc61b72ec960 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 13 Oct 2009 17:36:07 +0200 Subject: [PATCH] client: client_set_focus is static, so merge Signed-off-by: Julien Danjou --- objects/client.c | 25 ++++++++----------------- objects/client.h | 1 - 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/objects/client.c b/objects/client.c index 800e541bf..60463de06 100644 --- a/objects/client.c +++ b/objects/client.c @@ -224,21 +224,6 @@ client_hasproto(client_t *c, xcb_atom_t atom) return false; } -/** Sets focus on window - using xcb_set_input_focus or WM_TAKE_FOCUS - * \param c Client that should get focus - * \param set_input_focus Should we call xcb_set_input_focus - */ -void -client_set_focus(client_t *c, bool set_input_focus) -{ - bool takefocus = client_hasproto(c, WM_TAKE_FOCUS); - if(set_input_focus) - xcb_set_input_focus(globalconf.connection, XCB_INPUT_FOCUS_PARENT, - c->window, globalconf.timestamp); - if(takefocus) - xwindow_takefocus(c->window); -} - /** Prepare banning a client by running all needed lua events. * \param c The client. */ @@ -351,10 +336,16 @@ client_focus(client_t *c) /* X11 doesn't let you focus a window that isn't viewable */ client_unban(c); + /* Sets focus on window - using xcb_set_input_focus or WM_TAKE_FOCUS */ + if(!c->nofocus) + xcb_set_input_focus(globalconf.connection, XCB_INPUT_FOCUS_PARENT, + c->window, globalconf.timestamp); + + if(client_hasproto(c, WM_TAKE_FOCUS)) + xwindow_takefocus(c->window); + if (!c->nofocus) client_focus_update(c); - - client_set_focus(c, !c->nofocus); } static void diff --git a/objects/client.h b/objects/client.h index 2ce1bc3ab..952c91184 100644 --- a/objects/client.h +++ b/objects/client.h @@ -171,7 +171,6 @@ void client_set_skip_taskbar(lua_State *, int, bool); void client_focus(client_t *); void client_focus_update(client_t *); bool client_hasproto(client_t *, xcb_atom_t); -void client_set_focus(client_t *, bool); void client_ignore_enterleave_events(void); void client_restore_enterleave_events(void); void client_class_setup(lua_State *);