client: call unfocus hook when we changed focused client (FS#454)
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
a95fc407b5
commit
f711503d7b
20
client.c
20
client.c
|
@ -286,15 +286,8 @@ client_focus(client_t *c)
|
||||||
if (!window_hasproto(c->win, WM_TAKE_FOCUS) && c->nofocus)
|
if (!window_hasproto(c->win, WM_TAKE_FOCUS) && c->nofocus)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* unfocus current selected client
|
/* Save current focused client */
|
||||||
* We don't really need to unfocus here,
|
client_t *focused_before = globalconf.screen_focus->client_focus;
|
||||||
* because client already received FocusOut event.
|
|
||||||
* What we need to do is call unfocus hook, to
|
|
||||||
* inform lua script, about this event.
|
|
||||||
*/
|
|
||||||
if(globalconf.screen_focus->client_focus
|
|
||||||
&& c != globalconf.screen_focus->client_focus)
|
|
||||||
client_unfocus_hook(globalconf.screen_focus->client_focus);
|
|
||||||
|
|
||||||
/* stop hiding c */
|
/* stop hiding c */
|
||||||
c->ishidden = false;
|
c->ishidden = false;
|
||||||
|
@ -319,6 +312,15 @@ client_focus(client_t *c)
|
||||||
* And anyway, we have maybe unhidden */
|
* And anyway, we have maybe unhidden */
|
||||||
client_need_arrange(c);
|
client_need_arrange(c);
|
||||||
|
|
||||||
|
/* unfocus current selected client
|
||||||
|
* We don't really need to unfocus here,
|
||||||
|
* because client already received FocusOut event.
|
||||||
|
* What we need to do is call unfocus hook, to
|
||||||
|
* inform lua script, about this event.
|
||||||
|
*/
|
||||||
|
if(focused_before && c != focused_before)
|
||||||
|
client_unfocus_hook(focused_before);
|
||||||
|
|
||||||
/* execute hook */
|
/* execute hook */
|
||||||
if(globalconf.hooks.focus != LUA_REFNIL)
|
if(globalconf.hooks.focus != LUA_REFNIL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue