X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=9502edf51e43e806ab5794428992799b2d2b0d3c;hb=c8ef10a0e1d8b75a8ae6027383a5081a9a1b0ea0;hp=3476f6277540da8a07930ae3a68cd27b41699161;hpb=9a4ce94579bc7161d4ed55b20f00b3f76deff3e2;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index 3476f627..9502edf5 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 */ @@ -1369,7 +1369,7 @@ static void event_handle_client(ObClient *client, XEvent *e) ob_debug_type(OB_DEBUG_APP_BUGS, "_NET_ACTIVE_WINDOW message for window %s is " "missing source indication"); - client_activate(client, FALSE, TRUE, TRUE, + client_activate(client, TRUE, TRUE, TRUE, (e->xclient.data.l[0] == 0 || e->xclient.data.l[0] == 2)); } else if (msgtype == OBT_PROP_ATOM(NET_WM_MOVERESIZE)) { @@ -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;