Call XQueryPointer on arrange(...) to see if the pointer is over a client window

and reset the mouse key bindings if it's over the root
This commit is contained in:
Nikos Ntarmos 2008-01-07 21:00:04 +01:00 committed by Julien Danjou
parent a44277c84b
commit 283a21db81
1 changed files with 11 additions and 1 deletions

View File

@ -27,6 +27,7 @@
#include "xutil.h"
#include "focus.h"
#include "widget.h"
#include "window.h"
#include "ewmh.h"
#include "client.h"
#include "screen.h"
@ -56,6 +57,9 @@ arrange(int screen)
{
Client *c;
Tag **curtags = get_current_tags(screen);
Window client_win, root_win;
int x, y, d;
unsigned int m;
for(c = globalconf.clients; c; c = c->next)
{
@ -67,7 +71,13 @@ arrange(int screen)
}
curtags[0]->layout->arrange(screen);
focus(focus_get_current_client(screen), True, screen);
c = focus_get_current_client(screen);
focus(c, True, screen);
if(c && XQueryPointer(globalconf.display, RootWindow(globalconf.display, screen),
&root_win, &client_win, &x, &y, &d, &d, &m) &&
(root_win == None || client_win == None || client_win == root_win))
window_grabbuttons(c->screen, c->win, False, False);
p_delete(&curtags);
restack(screen);
}