X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=b048e7e64e7e95babf6c08f0536386d9bb99df5a;hb=5895fa84ac6f66f272be745505e76250c24d3ba1;hp=13586f706bc34d1da510f3e3f9030efb541fc77e;hpb=92bea590c0eff5f56f70093dfa1edef2f65b113f;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index 13586f70..b048e7e6 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -224,14 +224,15 @@ void event_process(XEvent *e) g_message("FocusIn on %lx mode %d detail %d", window, e->xfocus.mode, e->xfocus.detail); if (e->xfocus.detail == NotifyInferior || - e->xfocus.detail == NotifyAncestor || + /*e->xfocus.detail == NotifyAncestor ||*/ e->xfocus.detail > NotifyNonlinearVirtual) return; g_message("FocusIn on %lx", window); break; case FocusOut: g_message("FocusOut on %lx mode %d detail %d", window, e->xfocus.mode, e->xfocus.detail); - if (e->xfocus.detail == NotifyInferior || + if (e->xfocus.mode == NotifyGrab || + e->xfocus.detail == NotifyInferior || e->xfocus.detail == NotifyAncestor || e->xfocus.detail > NotifyNonlinearVirtual) return; @@ -243,12 +244,21 @@ void event_process(XEvent *e) if (XCheckTypedEvent(ob_display, FocusIn, &fi)) { event_process(&fi); - if (fi.xfocus.window == e->xfocus.window) - return; /* secret magic way of event_process telling us that no client - was found for the FocusIn event */ + was found for the FocusIn event. + + it should be noted!! that focus events of invalud types + (the ones that cause a return in the FocusIn case above) + will not cause this focus_fallback to be called. it will + be assumed that focus is going someplace sane still, or + there are more focus events coming to fix up the situation. + this may not be perfect.. but its working! and focus events + are too much headache to take that for granted. ktnx. ^_^ + */ if (fi.xfocus.window == None) focus_fallback(FALSE); + if (fi.xfocus.window == e->xfocus.window) + return; } else focus_fallback(FALSE); } @@ -275,7 +285,7 @@ void event_process(XEvent *e) else if (e->type == MapRequest) client_manage(window); else if (e->type == FocusIn) - e->xfocus.window = None; /* says no client was found for the event */ + e->xfocus.window = None; /* says a client was found for the event! */ else if (e->type == ConfigureRequest) { /* unhandled configure requests must be used to configure the window directly */