aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-node-view.c
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2003-03-23 18:26:11 +0800
committerXan Lopez <xan@src.gnome.org>2003-03-23 18:26:11 +0800
commitf360f793d3c18a3d0e9870f05d0a9787066f7046 (patch)
treed8b6b690d18b61b015ba281d2e1eb3f792463a91 /src/bookmarks/ephy-node-view.c
parent1cbf7f5f14b162826d5c016d836d8c2243986f58 (diff)
downloadgsoc2013-epiphany-f360f793d3c18a3d0e9870f05d0a9787066f7046.tar
gsoc2013-epiphany-f360f793d3c18a3d0e9870f05d0a9787066f7046.tar.gz
gsoc2013-epiphany-f360f793d3c18a3d0e9870f05d0a9787066f7046.tar.bz2
gsoc2013-epiphany-f360f793d3c18a3d0e9870f05d0a9787066f7046.tar.lz
gsoc2013-epiphany-f360f793d3c18a3d0e9870f05d0a9787066f7046.tar.xz
gsoc2013-epiphany-f360f793d3c18a3d0e9870f05d0a9787066f7046.tar.zst
gsoc2013-epiphany-f360f793d3c18a3d0e9870f05d0a9787066f7046.zip
Fix right click selection logic.
Fix right click selection logic.
Diffstat (limited to 'src/bookmarks/ephy-node-view.c')
-rw-r--r--src/bookmarks/ephy-node-view.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/bookmarks/ephy-node-view.c b/src/bookmarks/ephy-node-view.c
index 668e20757..2c97e4f33 100644
--- a/src/bookmarks/ephy-node-view.c
+++ b/src/bookmarks/ephy-node-view.c
@@ -255,12 +255,27 @@ ephy_node_view_button_press_cb (GtkTreeView *treeview,
GdkEventButton *event,
EphyNodeView *view)
{
+ GtkTreePath *path;
+ GtkTreeSelection *selection;
+
if (event->button == 3)
{
g_signal_emit (G_OBJECT (view), ephy_node_view_signals[SHOW_POPUP], 0);
- /* the event is handled, don't propagate it further (we avoid
- * changing the view with the right click this way) */
- return TRUE;
+ if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (treeview),
+ event->x,
+ event->y,
+ &path,
+ NULL, NULL, NULL))
+ {
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
+ if (gtk_tree_selection_path_is_selected (selection, path))
+ {
+ /* We handle the event (so the view won't be
+ * changed by the user click) because the user
+ * clicked on an already selected element */
+ return TRUE;
+ }
+ }
}
return FALSE;