[event] Only record mouse position on real button grabbing

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-03-28 17:49:11 +01:00
parent fb36ccee49
commit 6ee23de391
1 changed files with 6 additions and 6 deletions

12
event.c
View File

@ -260,12 +260,6 @@ event_handle_enternotify(XEvent *e)
&& ev->y_root == globalconf.pointer_y)) && ev->y_root == globalconf.pointer_y))
return; return;
/* the idea behind saving pointer_x and pointer_y is Bob Marley powered
* this will allow us top drop some EnterNotify events and thus not giving
* focus to windows appering under the cursor without a cursor move */
globalconf.pointer_x = ev->x_root;
globalconf.pointer_y = ev->y_root;
for(c = globalconf.clients; c; c = c->next) for(c = globalconf.clients; c; c = c->next)
if(c->titlebar.sw && c->titlebar.sw->window == ev->window) if(c->titlebar.sw && c->titlebar.sw->window == ev->window)
break; break;
@ -273,6 +267,12 @@ event_handle_enternotify(XEvent *e)
if(c || (c = client_get_bywin(globalconf.clients, ev->window))) if(c || (c = client_get_bywin(globalconf.clients, ev->window)))
{ {
window_grabbuttons(c->win, c->phys_screen); window_grabbuttons(c->win, c->phys_screen);
/* the idea behind saving pointer_x and pointer_y is Bob Marley powered
* this will allow us top drop some EnterNotify events and thus not giving
* focus to windows appering under the cursor without a cursor move */
globalconf.pointer_x = ev->x_root;
globalconf.pointer_y = ev->y_root;
if(globalconf.screens[c->screen].sloppy_focus) if(globalconf.screens[c->screen].sloppy_focus)
client_focus(c, c->screen, client_focus(c, c->screen,
globalconf.screens[c->screen].sloppy_focus_raise); globalconf.screens[c->screen].sloppy_focus_raise);