Make sloppy focus work on titlebars
This commit is contained in:
parent
4cab3c2d05
commit
f29b0660fa
10
event.c
10
event.c
|
@ -253,7 +253,11 @@ event_handle_enternotify(XEvent *e)
|
||||||
globalconf.pointer_x = ev->x_root;
|
globalconf.pointer_x = ev->x_root;
|
||||||
globalconf.pointer_y = ev->y_root;
|
globalconf.pointer_y = ev->y_root;
|
||||||
|
|
||||||
if((c = client_get_bywin(globalconf.clients, ev->window)))
|
for(c = globalconf.clients; c; c = c->next)
|
||||||
|
if(c->titlebar.sw && c->titlebar.sw->window == ev->window)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if(c || (c = client_get_bywin(globalconf.clients, ev->window)))
|
||||||
{
|
{
|
||||||
window_grabbuttons(get_phys_screen(c->screen), c->win);
|
window_grabbuttons(get_phys_screen(c->screen), c->win);
|
||||||
if(globalconf.screens[c->screen].sloppy_focus)
|
if(globalconf.screens[c->screen].sloppy_focus)
|
||||||
|
@ -264,8 +268,10 @@ event_handle_enternotify(XEvent *e)
|
||||||
else
|
else
|
||||||
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
||||||
if(ev->window == RootWindow(e->xany.display, screen))
|
if(ev->window == RootWindow(e->xany.display, screen))
|
||||||
|
{
|
||||||
window_root_grabbuttons(screen);
|
window_root_grabbuttons(screen);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Handle XMotion events
|
/** Handle XMotion events
|
||||||
|
|
Loading…
Reference in New Issue