missing a header
[dana/openbox.git] / openbox / event.c
index 142cf1f..9705fb6 100644 (file)
@@ -33,6 +33,7 @@
 #include "menuframe.h"
 #include "keyboard.h"
 #include "mouse.h"
+#include "hooks.h"
 #include "focus.h"
 #include "focus_cycle.h"
 #include "moveresize.h"
@@ -738,6 +739,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;
@@ -1721,7 +1727,8 @@ static gboolean event_handle_menu_input(XEvent *ev)
 
             else if (keycode == ob_keycode(OB_KEY_LEFT)) {
                 /* Left goes to the parent menu */
-                menu_frame_select(frame, NULL, TRUE);
+                if (frame->parent)
+                    menu_frame_select(frame, NULL, TRUE);
                 ret = TRUE;
             }