]> Dogcows Code - chaz/openbox/blobdiff - openbox/event.c
add helper functions for manipulating the focus_order list.
[chaz/openbox] / openbox / event.c
index 91aa5106985c583308e463342289f51e07aa09ac..eea6583be8248053b456a2e1f165910ac457be31 100644 (file)
@@ -284,14 +284,13 @@ static gboolean event_ignore(XEvent *e, Client *client)
                   e->xfocus.window, e->xfocus.mode, e->xfocus.detail);
 #endif
 
-        /* Try process a FocusIn first, and if a legit one isn't found, then
-           do the fallback shiznit. */
         {
             XEvent fe;
             gboolean fallback = TRUE;
 
             while (TRUE) {
-                if (!XCheckTypedEvent(ob_display, FocusOut, &fe))
+                if (!XCheckTypedWindowEvent(ob_display, FocusOut,
+                                            e->xfocus.window,&fe))
                     if (!XCheckTypedEvent(ob_display, FocusIn, &fe))
                         break;
                 if (fe.type == FocusOut) {
@@ -338,7 +337,7 @@ static gboolean event_ignore(XEvent *e, Client *client)
             e->xcrossing.detail == NotifyInferior ||
             (e->xcrossing.mode == NotifyUngrab &&
              e->xcrossing.detail == NotifyVirtual)) {
-#ifndef DEBUG_FOCUS
+#ifdef DEBUG_FOCUS
             g_message("%sNotify mode %d detail %d on %lx IGNORED",
                       (e->type == EnterNotify ? "Enter" : "Leave"),
                       e->xcrossing.mode,
@@ -346,7 +345,7 @@ static gboolean event_ignore(XEvent *e, Client *client)
 #endif
             return TRUE;
         }
-#ifndef DEBUG_FOCUS
+#ifdef DEBUG_FOCUS
         g_message("%sNotify mode %d detail %d on %lx",
                   (e->type == EnterNotify ? "Enter" : "Leave"),
                   e->xcrossing.mode,
@@ -407,7 +406,9 @@ static void event_process(XEvent *e)
             e->type == ButtonPress ||
             e->type == KeyPress || e->type == KeyRelease) {
             moveresize_event(e);
+
             return; /* no dispatch! */
+            
         }
 
     /* user input (action-bound) events */
@@ -497,7 +498,7 @@ static void event_handle_client(Client *client, XEvent *e)
 #endif
         /* focus state can affect the stacking layer */
         client_calc_layer(client);
-        frame_adjust_focus(client->frame);
+        frame_adjust_focus(client->frame, e->type == FocusIn);
        break;
     case EnterNotify:
         if (client_normal(client)) {
This page took 0.026129 seconds and 4 git commands to generate.