aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks-editor.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-04-16 01:36:46 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-04-16 01:36:46 +0800
commit81cc9fc7c119b8d45c28b0cdf1351e330f445264 (patch)
treec134ece6621a2360675c52ead30f0efcda34cb5a /src/bookmarks/ephy-bookmarks-editor.c
parent9d9872cea3a0bc588ee0d64f231d64510906efbb (diff)
downloadgsoc2013-epiphany-81cc9fc7c119b8d45c28b0cdf1351e330f445264.tar
gsoc2013-epiphany-81cc9fc7c119b8d45c28b0cdf1351e330f445264.tar.gz
gsoc2013-epiphany-81cc9fc7c119b8d45c28b0cdf1351e330f445264.tar.bz2
gsoc2013-epiphany-81cc9fc7c119b8d45c28b0cdf1351e330f445264.tar.lz
gsoc2013-epiphany-81cc9fc7c119b8d45c28b0cdf1351e330f445264.tar.xz
gsoc2013-epiphany-81cc9fc7c119b8d45c28b0cdf1351e330f445264.tar.zst
gsoc2013-epiphany-81cc9fc7c119b8d45c28b0cdf1351e330f445264.zip
Fix context menu selection mess, tricky, tricky, tricky. It's all kris
2003-04-15 Marco Pesenti Gritti <marco@it.gnome.org> * src/bookmarks/ephy-bookmarks-editor.c: (ephy_bookmarks_editor_update_menu), (ephy_bookmarks_editor_show_popup_cb), (keyword_node_show_popup_cb), (menu_activate_cb): * src/bookmarks/ephy-node-view.c: (ephy_node_view_selection_changed_cb), (get_node_from_path), (ephy_node_view_button_press_cb), (ephy_node_view_init), (ephy_node_view_get_selection), (ephy_node_view_has_selection): Fix context menu selection mess, tricky, tricky, tricky. It's all kris fault.
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-editor.c')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c50
1 files changed, 30 insertions, 20 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 885f034a8..3992cc0e1 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -454,18 +454,6 @@ ephy_bookmarks_editor_finalize (GObject *object)
}
static void
-ephy_bookmarks_editor_show_popup_cb (GtkWidget *view,
- EphyBookmarksEditor *editor)
-{
- GtkWidget *widget;
-
- widget = egg_menu_merge_get_widget (editor->priv->ui_merge,
- "/popups/EphyBookmarkEditorPopup");
- gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL, 2,
- gtk_get_current_event_time ());
-}
-
-static void
ephy_bookmarks_editor_node_activated_cb (GtkWidget *view,
EphyNode *node,
EphyBookmarksEditor *editor)
@@ -493,7 +481,8 @@ ephy_bookmarks_editor_node_activated_cb (GtkWidget *view,
}
static void
-ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor)
+ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor,
+ GtkWidget *selected_view)
{
gboolean open_in_window, open_in_tab,
rename, delete, properties;
@@ -508,11 +497,19 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor)
GList *selected;
GtkWidget *focus_widget;
- bmk_focus = gtk_widget_is_focus (editor->priv->bm_view);
- key_focus = gtk_widget_is_focus (editor->priv->key_view);
-
+ if (selected_view)
+ {
+ bmk_focus = (selected_view == editor->priv->bm_view);
+ key_focus = (selected_view == editor->priv->key_view);
+ }
+ else
+ {
+ bmk_focus = gtk_widget_is_focus (editor->priv->bm_view);
+ key_focus = gtk_widget_is_focus (editor->priv->key_view);
+ }
+
focus_widget = gtk_window_get_focus (GTK_WINDOW (editor));
-
+
if (GTK_IS_EDITABLE (focus_widget))
{
gboolean has_selection;
@@ -539,7 +536,7 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor)
(EPHY_NODE_VIEW (editor->priv->key_view), NULL);
selected = ephy_node_view_get_selection (EPHY_NODE_VIEW (editor->priv->key_view));
- if (selected)
+ if (key_focus && selected)
{
EphyNode *node = EPHY_NODE (selected->data);
EphyBookmarksKeywordPriority priority;;
@@ -594,6 +591,19 @@ ephy_bookmarks_editor_update_menu (EphyBookmarksEditor *editor)
}
static void
+ephy_bookmarks_editor_show_popup_cb (GtkWidget *view,
+ EphyBookmarksEditor *editor)
+{
+ GtkWidget *widget;
+
+ widget = egg_menu_merge_get_widget (editor->priv->ui_merge,
+ "/popups/EphyBookmarkEditorPopup");
+ ephy_bookmarks_editor_update_menu (editor, view);
+ gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL, 2,
+ gtk_get_current_event_time ());
+}
+
+static void
ephy_bookmarks_editor_dispose (GObject *object)
{
EphyBookmarksEditor *editor;
@@ -706,7 +716,7 @@ keyword_node_show_popup_cb (GtkWidget *view, EphyBookmarksEditor *editor)
widget = egg_menu_merge_get_widget (editor->priv->ui_merge,
"/popups/EphyBookmarkKeywordPopup");
- ephy_bookmarks_editor_update_menu (editor);
+ ephy_bookmarks_editor_update_menu (editor, view);
gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL, 2,
gtk_get_current_event_time ());
}
@@ -821,7 +831,7 @@ static void
menu_activate_cb (EphyNodeView *view,
EphyBookmarksEditor *editor)
{
- ephy_bookmarks_editor_update_menu (editor);
+ ephy_bookmarks_editor_update_menu (editor, NULL);
}
static void