only focus if new entered windows in != than currently focused

This commit is contained in:
Julien Danjou 2007-10-11 11:41:40 +02:00
parent c05ed01c1a
commit 4f1940d94f
1 changed files with 6 additions and 3 deletions

View File

@ -348,11 +348,14 @@ handle_event_enternotify(XEvent * e, awesome_config *awesomeconf)
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
return; return;
if((c = getclient(ev->window))) if((c = getclient(ev->window)))
{
if(!sel || sel != c)
{ {
focus(c->display, c, ev->same_screen, &awesomeconf[c->screen]); focus(c->display, c, ev->same_screen, &awesomeconf[c->screen]);
if (sel && (sel->isfloating || IS_ARRANGE(sel->screen, layout_floating))) if (sel && (sel->isfloating || IS_ARRANGE(sel->screen, layout_floating)))
grabbuttons(sel, True, False, awesomeconf->modkey, awesomeconf->numlockmask); grabbuttons(sel, True, False, awesomeconf->modkey, awesomeconf->numlockmask);
} }
}
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))