diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-11-08 03:32:17 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-11-08 03:32:17 +0800 |
commit | 934fafce5581c0cff57a9712d0816557a3f61f34 (patch) | |
tree | 4a7c31c7565a8987b33dd1850abd8d28bb65b21d /src/bookmarks/ephy-bookmark-action.c | |
parent | 10b9e346654223940392f8c9e19b77b552e5ba79 (diff) | |
download | gsoc2013-epiphany-934fafce5581c0cff57a9712d0816557a3f61f34.tar gsoc2013-epiphany-934fafce5581c0cff57a9712d0816557a3f61f34.tar.gz gsoc2013-epiphany-934fafce5581c0cff57a9712d0816557a3f61f34.tar.bz2 gsoc2013-epiphany-934fafce5581c0cff57a9712d0816557a3f61f34.tar.lz gsoc2013-epiphany-934fafce5581c0cff57a9712d0816557a3f61f34.tar.xz gsoc2013-epiphany-934fafce5581c0cff57a9712d0816557a3f61f34.tar.zst gsoc2013-epiphany-934fafce5581c0cff57a9712d0816557a3f61f34.zip |
When popping up the context menu with keyboard, select the first menu
2004-11-07 Christian Persch <chpe@cvs.gnome.org>
* 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.
Diffstat (limited to 'src/bookmarks/ephy-bookmark-action.c')
-rw-r--r-- | src/bookmarks/ephy-bookmark-action.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index a1e12f15b..27ab1d870 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -533,7 +533,9 @@ properties_activate_cb (GtkWidget *menu, } static void -show_context_menu (EphyBookmarkAction *action, GtkWidget *proxy, +show_context_menu (EphyBookmarkAction *action, + GtkWidget *proxy, + GdkEventButton *event, GtkMenuPositionFunc func) { GtkWidget *menu, *item; @@ -593,8 +595,17 @@ show_context_menu (EphyBookmarkAction *action, GtkWidget *proxy, g_signal_connect (item, "activate", G_CALLBACK (move_right_activate_cb), proxy); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, func, proxy, 3, - gtk_get_current_event_time ()); + if (event != NULL) + { + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, func, proxy, + event->button, event->time); + } + else + { + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, func, proxy, 0, + gtk_get_current_event_time ()); + gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE); + } } static gboolean @@ -602,7 +613,7 @@ popup_menu_cb (GtkWidget *widget, EphyBookmarkAction *action) { if (gtk_widget_get_ancestor (widget, EPHY_TYPE_BOOKMARKSBAR)) { - show_context_menu (action, widget, + show_context_menu (action, widget, NULL, ephy_gui_menu_position_under_widget); return TRUE; } @@ -618,7 +629,7 @@ button_press_cb (GtkWidget *widget, if (event->button == 3 && gtk_widget_get_ancestor (widget, EPHY_TYPE_BOOKMARKSBAR)) { - show_context_menu (action, widget, NULL); + show_context_menu (action, widget, event, NULL); return TRUE; } else if (event->button == 2) |