From: Dana Jansens Date: Sun, 22 Apr 2007 00:53:21 +0000 (+0000) Subject: better event handling for menus X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=b6897feb409e14b3bfb71724a72f52e798f5a3ef;p=chaz%2Fopenbox better event handling for menus --- diff --git a/openbox/event.c b/openbox/event.c index 00de8b36..7c85e842 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1276,17 +1276,12 @@ static void event_handle_menu(XEvent *ev) } break; case LeaveNotify: - if ((e = g_hash_table_lookup(menu_frame_map, &ev->xcrossing.window))) { - if (e->entry->type != OB_MENU_ENTRY_TYPE_SUBMENU) - menu_frame_select(e->frame, NULL); - } - case MotionNotify: - if ((e = menu_entry_frame_under(ev->xmotion.x_root, - ev->xmotion.y_root))) { - /* XXX menu_frame_entry_move_on_screen(f); */ - menu_frame_select(e->frame, e); + if ((e = g_hash_table_lookup(menu_frame_map, &ev->xcrossing.window)) && + (f = find_active_menu()) && f->selected == e && + e->entry->type != OB_MENU_ENTRY_TYPE_SUBMENU) + { + menu_frame_select(e->frame, NULL); } - break; case KeyPress: if (ev->xkey.keycode == ob_keycode(OB_KEY_ESCAPE)) menu_frame_hide_all(); diff --git a/openbox/menuframe.c b/openbox/menuframe.c index c417c05a..a5c301ed 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -738,7 +738,8 @@ gboolean menu_frame_show_submenu(ObMenuFrame *self, ObMenuFrame *parent, XMapWindow(ob_display, self->window); - if (screen_pointer_pos(&dx, &dy) && (e = menu_entry_frame_under(dx, dy))) + if (screen_pointer_pos(&dx, &dy) && (e = menu_entry_frame_under(dx, dy)) && + e->frame == self) ++e->ignore_enters; return TRUE;