]> Dogcows Code - chaz/openbox/commitdiff
focus... works...? i have all cases of mozilla working, with RevertToPointerRoot...
authorDana Jansens <danakj@orodu.net>
Fri, 28 Mar 2003 11:05:38 +0000 (11:05 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 28 Mar 2003 11:05:38 +0000 (11:05 +0000)
openbox/event.c

index aaa4c7684b19f3d3299239be2b8801673608393e..fc8b6fff175bd5a973ff5decffd2dc3d805ff6bc 100644 (file)
@@ -149,6 +149,8 @@ void event_process(XEvent *e)
             window = e->xany.window;
     }
      
+    client = g_hash_table_lookup(client_map, &window);
+
     /* grab the lasttime and hack up the state */
     switch (e->type) {
     case ButtonPress:
@@ -223,6 +225,16 @@ void event_process(XEvent *e)
     case FocusIn:
         g_message("FocusIn on %lx mode %d detail %d", window,
                   e->xfocus.mode, e->xfocus.detail);
+        if (client == NULL) {
+            /* says a client was not found for the event!
+               this is important whether the event is a valid type for us or
+               not! this makes the evil known as mozilla not DESTROY my
+               precious wm!! YES ITS FIVE AM AND I AM NOT SANE RIGHT NOW. FOCUS
+               EVENTS WILL DRIVE YOU MAD.
+             */
+            e->xfocus.window = None;
+        }
+
         /* NotifyAncestor is not ignored in FocusIn like it is in FocusOut
            because of RevertToPointerRoot. If the focus ends up reverting to
            pointer root on a workspace change, then the FocusIn event that we
@@ -250,16 +262,7 @@ void event_process(XEvent *e)
                event_process(&fi);
 
                 /* secret magic way of event_process telling us that no client
-                   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. ^_^
-                */
+                   was found for the FocusIn event. ^_^ */
                 if (fi.xfocus.window == None)
                     focus_fallback(FALSE);
                 if (fi.xfocus.window == e->xfocus.window)
@@ -280,8 +283,6 @@ void event_process(XEvent *e)
         break;
     }
 
-    client = g_hash_table_lookup(client_map, &window);
-
     /* deal with it in the kernel */
     if (client)
        event_handle_client(client, e);
@@ -289,8 +290,6 @@ void event_process(XEvent *e)
        event_handle_root(e);
     else if (e->type == MapRequest)
        client_manage(window);
-    else if (e->type == FocusIn)
-       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 */
This page took 0.025701 seconds and 4 git commands to generate.