summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-31 06:36:59 +0000
committerDana Jansens <danakj@orodu.net>2003-03-31 06:36:59 +0000
commite6818c741c8456a8082fad86171fa336b0e89a1e (patch)
tree2724b07f88c45e3c96cf91a4247dcc442be074aa /openbox
parenta8afa4d073037565d6d07b08e1ee4883fd9ec59d (diff)
yet more haxes to make focus events work the way i want. this is rough shit.
Diffstat (limited to 'openbox')
-rw-r--r--openbox/event.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/openbox/event.c b/openbox/event.c
index 8d1f4449..2d144519 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -232,7 +232,8 @@ void event_process(XEvent *e)
for FocusOut, so it is safely ignored there.
*/
if (e->xfocus.detail == NotifyInferior ||
- e->xfocus.detail > NotifyNonlinearVirtual || client == NULL) {
+ e->xfocus.detail > NotifyNonlinearVirtual ||
+ client == NULL) {
/* says a client was not found for the event (or a valid FocusIn
event was not found.
*/
@@ -254,13 +255,21 @@ void event_process(XEvent *e)
/* Try process a FocusIn first, and if a legit one isn't found, then
do the fallback shiznit. */
{
- XEvent fi;
+ XEvent fi, fo;
+ gboolean isfo = FALSE;
+
if (XCheckTypedEvent(ob_display, FocusIn, &fi)) {
event_process(&fi);
+ /* when we have gotten a fi/fo pair, then see if there are any
+ more fo's coming. if there are, then don't fallback just yet
+ */
+ if ((isfo = XCheckTypedEvent(ob_display, FocusOut, &fo)))
+ XPutBackEvent(ob_display, &fo);
+
/* secret magic way of event_process telling us that no client
was found for the FocusIn event. ^_^ */
- if (fi.xfocus.window == None)
+ if (!isfo && fi.xfocus.window == None)
focus_fallback(FALSE);
if (fi.xfocus.window == e->xfocus.window)
return;