Retain focus on clients moved across screens (fs#620)
Signed-off-by: Perry Hargrave <resixian@gmail.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
a23817718e
commit
d8883f89fc
8
screen.c
8
screen.c
|
@ -264,10 +264,14 @@ screen_client_moveto(client_t *c, screen_t *new_screen, bool doresize)
|
|||
{
|
||||
screen_t *old_screen = c->screen;
|
||||
area_t from, to;
|
||||
bool had_focus = false;
|
||||
|
||||
if(new_screen == c->screen)
|
||||
return;
|
||||
|
||||
if (globalconf.screens.tab[c->phys_screen].client_focus == c)
|
||||
had_focus = true;
|
||||
|
||||
c->screen = new_screen;
|
||||
|
||||
if(c->titlebar)
|
||||
|
@ -284,6 +288,8 @@ screen_client_moveto(client_t *c, screen_t *new_screen, bool doresize)
|
|||
luaA_object_push(globalconf.L, c);
|
||||
luaA_object_emit_signal(globalconf.L, -1, "property::screen", 0);
|
||||
lua_pop(globalconf.L, 1);
|
||||
if(had_focus)
|
||||
client_focus(c);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -337,6 +343,8 @@ screen_client_moveto(client_t *c, screen_t *new_screen, bool doresize)
|
|||
luaA_object_push(globalconf.L, c);
|
||||
luaA_object_emit_signal(globalconf.L, -1, "property::screen", 0);
|
||||
lua_pop(globalconf.L, 1);
|
||||
if(had_focus)
|
||||
client_focus(c);
|
||||
}
|
||||
|
||||
/** Push a screen onto the stack.
|
||||
|
|
Loading…
Reference in New Issue