+
+ if(ioncore_g.focus_next!=NULL &&
+ ioncore_g.focus_next_source<IONCORE_FOCUSNEXT_FALLBACK){
+ return;
+ }
+
+ if((ev->detail==NotifyPointerRoot || ev->detail==NotifyDetailNone)
+ && ev->window==region_root_of(reg) /* OBJ_IS(reg, WRootWin) */){
+ /* Restore focus if it was returned to a root window and we don't
+ * know of a pending focus change.
+ */
+ if(pointer_in_root(ev->window)){
+ region_set_focus(reg);
+ ioncore_g.focus_next_source=IONCORE_FOCUSNEXT_FALLBACK;
+ }
+ }else{
+ /* Something got the focus, don't use fallback. */
+ ioncore_g.focus_next=NULL;
+ }