]> Dogcows Code - chaz/openbox/blobdiff - openbox/event.c
queue hooks so that they don't run as each thing happens, instead run them at the...
[chaz/openbox] / openbox / event.c
index 4d1b6abaa90009d88c7925004c9b5f295c3cbb06..2563be2b62c8fae4772b18d7245b5935c395daff 100644 (file)
@@ -738,6 +738,11 @@ static void event_process(const XEvent *ec, gpointer data)
              e->type == MotionNotify)
         event_handle_user_input(client, e);
 
+    XFlush(obt_display);
+
+    /* run all the hooks at once */
+    hooks_run_queue();
+
     /* if something happens and it's not from an XEvent, then we don't know
        the time */
     event_curtime = CurrentTime;
@@ -1884,11 +1889,16 @@ static void event_handle_user_input(ObClient *client, XEvent *e)
             if (!client || !frame_iconify_animating(client->frame))
                 mouse_event(client, e);
         } else
-            keyboard_event((focus_cycle_target ? focus_cycle_target :
-                            (client ? client : focus_client)), e);
+            keyboard_event(event_target_client(client), e);
     }
 }
 
+ObClient* event_target_client(ObClient *client)
+{
+    return (focus_cycle_target ? focus_cycle_target :
+            (client ? client : focus_client));
+}
+
 static void focus_delay_dest(gpointer data)
 {
     g_free(data);
This page took 0.020428 seconds and 4 git commands to generate.