[epiphany] ephy-page-menu-action: try to use the actual activate event when possible



commit b162aed9c4c965dc506dd951c94d9c080042e889
Author: Xan Lopez <xan igalia com>
Date:   Thu Jan 12 19:41:53 2012 +0100

    ephy-page-menu-action: try to use the actual activate event when possible
    
    Otherwise fallback to faking it as before.

 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 d5c6592..308d6c1 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]