From 934fafce5581c0cff57a9712d0816557a3f61f34 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 7 Nov 2004 19:32:17 +0000 Subject: When popping up the context menu with keyboard, select the first menu 2004-11-07 Christian Persch * lib/widgets/ephy-node-view.c: (ephy_node_view_popup): * src/bookmarks/ephy-bookmark-action.c: (show_context_menu), (popup_menu_cb), (button_press_cb): * src/bookmarks/ephy-topic-action.c: (button_toggled_cb), (show_context_menu), (popup_menu_cb), (button_press_cb): * src/ephy-window.c: (show_embed_popup): When popping up the context menu with keyboard, select the first menu item. Fixes bug #154907. --- lib/widgets/ephy-node-view.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/widgets') diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c index 2a0ec2d6f..2f3df35e7 100644 --- a/lib/widgets/ephy-node-view.c +++ b/lib/widgets/ephy-node-view.c @@ -1581,14 +1581,19 @@ ephy_node_view_popup (EphyNodeView *view, GtkWidget *menu) { if (event->type == GDK_KEY_PRESS) { + GdkEventKey *key = (GdkEventKey *) event; + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, ephy_gui_menu_position_tree_selection, - view, 2, gtk_get_current_event_time ()); + view, 0, key->time); + gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE); } - else + else if (event->type == GDK_BUTTON_PRESS) { + GdkEventButton *button = (GdkEventButton *) event; + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, - NULL, 2, gtk_get_current_event_time ()); + NULL, button->button, button->time); } gdk_event_free (event); -- cgit v1.2.3