aboutsummaryrefslogtreecommitdiffstats
path: root/lib/widgets/ephy-node-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/widgets/ephy-node-view.c')
-rw-r--r--lib/widgets/ephy-node-view.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c
index 0afbb9844..dc23e5efa 100644
--- a/lib/widgets/ephy-node-view.c
+++ b/lib/widgets/ephy-node-view.c
@@ -29,6 +29,7 @@
#include <gtk/gtkcellrenderertoggle.h>
#include <gtk/gtktreemodelfilter.h>
#include <gtk/gtkwindow.h>
+#include <gtk/gtkmain.h>
#include <gdk/gdkkeysyms.h>
#include "ephy-node-view.h"
@@ -1577,6 +1578,30 @@ ephy_node_view_add_toggle (EphyNodeView *view, EphyTreeModelNodeValueFunc value_
gtk_tree_view_append_column (GTK_TREE_VIEW (view), col);
}
+void
+ephy_node_view_popup (EphyNodeView *view, GtkWidget *menu)
+{
+ GdkEvent *event;
+
+ event = gtk_get_current_event ();
+ if (event)
+ {
+ if (event->type == GDK_KEY_PRESS)
+ {
+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
+ ephy_gui_menu_position_tree_selection,
+ view, 2, gtk_get_current_event_time ());
+ }
+ else
+ {
+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL,
+ NULL, 2, gtk_get_current_event_time ());
+ }
+
+ gdk_event_free (event);
+ }
+}
+
static void
ephy_node_view_class_init (EphyNodeViewClass *klass)
{