client: client_set_focus is static, so merge
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
195dac628b
commit
63e4ba460b
|
@ -224,21 +224,6 @@ client_hasproto(client_t *c, xcb_atom_t atom)
|
||||||
return false;
|
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.
|
/** Prepare banning a client by running all needed lua events.
|
||||||
* \param c The client.
|
* \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 */
|
/* X11 doesn't let you focus a window that isn't viewable */
|
||||||
client_unban(c);
|
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)
|
if (!c->nofocus)
|
||||||
client_focus_update(c);
|
client_focus_update(c);
|
||||||
|
|
||||||
client_set_focus(c, !c->nofocus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -171,7 +171,6 @@ void client_set_skip_taskbar(lua_State *, int, bool);
|
||||||
void client_focus(client_t *);
|
void client_focus(client_t *);
|
||||||
void client_focus_update(client_t *);
|
void client_focus_update(client_t *);
|
||||||
bool client_hasproto(client_t *, xcb_atom_t);
|
bool client_hasproto(client_t *, xcb_atom_t);
|
||||||
void client_set_focus(client_t *, bool);
|
|
||||||
void client_ignore_enterleave_events(void);
|
void client_ignore_enterleave_events(void);
|
||||||
void client_restore_enterleave_events(void);
|
void client_restore_enterleave_events(void);
|
||||||
void client_class_setup(lua_State *);
|
void client_class_setup(lua_State *);
|
||||||
|
|
Loading…
Reference in New Issue