From 6ff2109adbfe6fea4c3a4b05ecab851fdf1f72f7 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 22 Nov 2011 21:56:10 +0100 Subject: [PATCH] Make Paste and Proceed insensitive if nothing to paste --- midori/midori-locationaction.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 36fe369d..bbb7c6ca 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -1274,6 +1274,8 @@ midori_location_action_populate_popup_cb (GtkWidget* entry, MidoriBrowser* browser = midori_browser_get_for_widget (entry); GtkActionGroup* actions = midori_browser_get_action_group (browser); GtkWidget* menuitem; + GtkClipboard* clipboard = gtk_clipboard_get_for_display ( + gtk_widget_get_display (entry),GDK_SELECTION_CLIPBOARD); menuitem = gtk_separator_menu_item_new (); gtk_widget_show (menuitem); @@ -1288,6 +1290,8 @@ midori_location_action_populate_popup_cb (GtkWidget* entry, gtk_menu_shell_insert (menu, menuitem, 3); g_signal_connect (menuitem, "activate", G_CALLBACK (midori_location_action_paste_proceed_cb), location_action); + if (!gtk_clipboard_wait_is_text_available (clipboard)) + gtk_widget_set_sensitive (menuitem, FALSE); } static void