readd some code to check where the mouse is on tag switching

This commit is contained in:
Julien Danjou 2008-02-04 14:16:14 +01:00
parent 1b4a1e7c9e
commit 2ad8e005ad
1 changed files with 10 additions and 0 deletions

View File

@ -56,6 +56,9 @@ arrange(int screen)
{ {
Client *c; Client *c;
Layout *curlay = get_current_layout(screen); Layout *curlay = get_current_layout(screen);
unsigned int dui;
int di, x, y;
Window rootwin, childwin;
for(c = globalconf.clients; c; c = c->next) for(c = globalconf.clients; c; c = c->next)
{ {
@ -84,6 +87,13 @@ arrange(int screen)
if((c = focus_get_current_client(screen)) && !globalconf.focus->client) if((c = focus_get_current_client(screen)) && !globalconf.focus->client)
client_focus(c, screen, False); client_focus(c, screen, False);
/* check that the mouse is on a window or not */
if(XQueryPointer(globalconf.display, RootWindow(globalconf.display,
get_phys_screen(screen)),
&rootwin, &childwin, &x, &y, &di, &di, &dui)
&& (rootwin == None || childwin == None || childwin == rootwin))
window_root_grabbuttons(screen);
/* reset status */ /* reset status */
globalconf.screens[screen].need_arrange = False; globalconf.screens[screen].need_arrange = False;
} }