From 952729e4ae66646c0817b98ae46e1a282dec35b1 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 18 Oct 2008 23:21:06 +0200 Subject: [PATCH] Show URL in New Tab menu item only over selections --- midori/midori-view.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/midori/midori-view.c b/midori/midori-view.c index 3bad796b..680c266e 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -895,8 +895,10 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view, GList* items; gboolean has_selection; - /* We do not want to modify the Edit menu. - The only reliable indicator is inspecting the first item. */ + has_selection = midori_view_has_selection (view); + + /* Unfortunately inspecting the menu is the only way to + determine that the mouse is over a text area or selection. */ items = gtk_container_get_children (GTK_CONTAINER (menu)); menuitem = (GtkWidget*)g_list_nth_data (items, 0); if (GTK_IS_IMAGE_MENU_ITEM (menuitem)) @@ -905,10 +907,10 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view, gtk_image_get_stock (GTK_IMAGE (icon), &stock_id, NULL); if (!strcmp (stock_id, GTK_STOCK_CUT)) return; + if (strcmp (stock_id, GTK_STOCK_FIND)) + has_selection = FALSE; } - has_selection = midori_view_has_selection (view); - if (view->link_uri) { menuitem = gtk_image_menu_item_new_with_mnemonic ( -- 2.39.5