X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=cedac2e3f29e28d758494f8bc197e3e7905239f4;hb=f86fa2b3b49b1e790e84bd041f3e91cb63f369a4;hp=3476f6277540da8a07930ae3a68cd27b41699161;hpb=9a4ce94579bc7161d4ed55b20f00b3f76deff3e2;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index 3476f627..cedac2e3 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -86,7 +86,7 @@ static void event_process(const XEvent *e, gpointer data); static void event_handle_root(XEvent *e); static gboolean event_handle_menu_input(XEvent *e); static void event_handle_menu(ObMenuFrame *frame, XEvent *e); -static void event_handle_prompt(ObPrompt *p, XEvent *e); +static gboolean event_handle_prompt(ObPrompt *p, XEvent *e); static void event_handle_dock(ObDock *s, XEvent *e); static void event_handle_dockapp(ObDockApp *app, XEvent *e); static void event_handle_client(ObClient *c, XEvent *e); @@ -712,8 +712,8 @@ static void event_process(const XEvent *ec, gpointer data) } #endif - if (prompt) - event_handle_prompt(prompt, e); + if (prompt && event_handle_prompt(prompt, e)) + ; else if (e->type == ButtonPress || e->type == ButtonRelease) { /* If the button press was on some non-root window, or was physically on the root window, then process it */ @@ -1682,25 +1682,26 @@ static ObMenuFrame* find_active_or_last_menu(void) return ret; } -static void event_handle_prompt(ObPrompt *p, XEvent *e) +static gboolean event_handle_prompt(ObPrompt *p, XEvent *e) { switch (e->type) { case ButtonPress: case ButtonRelease: case MotionNotify: - prompt_mouse_event(p, e); + return prompt_mouse_event(p, e); break; case KeyPress: - prompt_key_event(p, e); + return prompt_key_event(p, e); break; } + return FALSE; } static gboolean event_handle_menu_input(XEvent *ev) { gboolean ret = FALSE; - if (ev->type == ButtonRelease) { + if (ev->type == ButtonRelease || ev->type == ButtonPress) { ObMenuEntryFrame *e; if (menu_hide_delay_reached() && @@ -1709,10 +1710,13 @@ static gboolean event_handle_menu_input(XEvent *ev) if ((e = menu_entry_frame_under(ev->xbutton.x_root, ev->xbutton.y_root))) { + if (ev->type == ButtonPress && e->frame->child) + menu_frame_select(e->frame->child, NULL, TRUE); menu_frame_select(e->frame, e, TRUE); - menu_entry_frame_execute(e, ev->xbutton.state); + if (ev->type == ButtonRelease) + menu_entry_frame_execute(e, ev->xbutton.state); } - else + else if (ev->type == ButtonRelease) menu_frame_hide_all(); } ret = TRUE;