Fix bug when switching focus to an empty screen
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
06ac58cd6e
commit
7605585aee
10
client.c
10
client.c
|
@ -184,6 +184,8 @@ client_ban(Client *c)
|
||||||
Bool
|
Bool
|
||||||
client_focus(Client *c, int screen, Bool raise)
|
client_focus(Client *c, int screen, Bool raise)
|
||||||
{
|
{
|
||||||
|
int phys_screen;
|
||||||
|
|
||||||
/* if c is NULL or invisible, take next client in the focus history */
|
/* if c is NULL or invisible, take next client in the focus history */
|
||||||
if((!c || (c && (!client_isvisible(c, screen))))
|
if((!c || (c && (!client_isvisible(c, screen))))
|
||||||
&& !(c = focus_get_current_client(screen)))
|
&& !(c = focus_get_current_client(screen)))
|
||||||
|
@ -215,14 +217,18 @@ client_focus(Client *c, int screen, Bool raise)
|
||||||
/* since we're dropping EnterWindow events and sometimes the window
|
/* since we're dropping EnterWindow events and sometimes the window
|
||||||
* will appear under the mouse, grabbuttons */
|
* will appear under the mouse, grabbuttons */
|
||||||
window_grabbuttons(c->win, c->phys_screen);
|
window_grabbuttons(c->win, c->phys_screen);
|
||||||
|
phys_screen = c->phys_screen;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
phys_screen = screen_virttophys(screen);
|
||||||
XSetInputFocus(globalconf.display,
|
XSetInputFocus(globalconf.display,
|
||||||
RootWindow(globalconf.display, screen_virttophys(screen)),
|
RootWindow(globalconf.display, phys_screen),
|
||||||
RevertToPointerRoot, CurrentTime);
|
RevertToPointerRoot, CurrentTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
ewmh_update_net_active_window(phys_screen);
|
||||||
widget_invalidate_cache(screen, WIDGET_CACHE_CLIENTS);
|
widget_invalidate_cache(screen, WIDGET_CACHE_CLIENTS);
|
||||||
ewmh_update_net_active_window(c->phys_screen);
|
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue