diff options
author | Xan Lopez <xan@igalia.com> | 2012-01-13 02:41:53 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-01-14 04:21:46 +0800 |
commit | b162aed9c4c965dc506dd951c94d9c080042e889 (patch) | |
tree | 4184c3b3e14955d564e7fbe47dd7ad3e371ed1ab | |
parent | 0eefbc613817e5a5f039c5830fdbdb80fc72f052 (diff) | |
download | gsoc2013-epiphany-b162aed9c4c965dc506dd951c94d9c080042e889.tar gsoc2013-epiphany-b162aed9c4c965dc506dd951c94d9c080042e889.tar.gz gsoc2013-epiphany-b162aed9c4c965dc506dd951c94d9c080042e889.tar.bz2 gsoc2013-epiphany-b162aed9c4c965dc506dd951c94d9c080042e889.tar.lz gsoc2013-epiphany-b162aed9c4c965dc506dd951c94d9c080042e889.tar.xz gsoc2013-epiphany-b162aed9c4c965dc506dd951c94d9c080042e889.tar.zst gsoc2013-epiphany-b162aed9c4c965dc506dd951c94d9c080042e889.zip |
ephy-page-menu-action: try to use the actual activate event when possible
Otherwise fallback to faking it as before.
-rw-r--r-- | src/ephy-page-menu-action.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ephy-page-menu-action.c b/src/ephy-page-menu-action.c index d5c6592b4..308d6c1b0 100644 --- a/src/ephy-page-menu-action.c +++ b/src/ephy-page-menu-action.c @@ -62,6 +62,9 @@ ephy_page_menu_action_activate (GtkAction *action) GtkUIManager *manager; GSList *list; GtkWidget *button; + GdkEvent *event; + guint activate_button = 1; + guint32 activate_time = 0; window = _ephy_navigation_action_get_window (EPHY_NAVIGATION_ACTION (action)); manager = GTK_UI_MANAGER (ephy_window_get_ui_manager (window)); @@ -71,9 +74,17 @@ ephy_page_menu_action_activate (GtkAction *action) if (GTK_IS_TOOL_BUTTON (list->data)) button = GTK_WIDGET (list->data); + event = gtk_get_current_event (); + if (event && event->type == GDK_BUTTON_PRESS) { + activate_button = event->button.button; + activate_time = event->button.time; + + gdk_event_free (event); + } + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, (GtkMenuPositionFunc)menu_position_func, button, - 1, 0); + activate_button, activate_time); } static void |