From 283a21db81079f258de5d0fc889db7d3ceaab956 Mon Sep 17 00:00:00 2001 From: Nikos Ntarmos Date: Mon, 7 Jan 2008 21:00:04 +0100 Subject: [PATCH] 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 --- layout.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/layout.c b/layout.c index d441d463..d82861ee 100644 --- a/layout.c +++ b/layout.c @@ -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); }