[epiphany] Remove ability to open URIs in the clipboard through middle click



commit d844231d3ff566547bb400140af55da4b8a8c476
Author: Xan Lopez <xan igalia com>
Date:   Thu Jan 17 23:55:07 2013 +0100

    Remove ability to open URIs in the clipboard through middle click
    
    This is disabled by default, pretty obscure, and problematic to port
    properly to WebKit2. So just drop the code.

 data/epiphany.convert               |    1 -
 data/org.gnome.epiphany.gschema.xml |    5 --
 lib/ephy-prefs.h                    |    1 -
 src/ephy-window.c                   |   78 -----------------------------------
 4 files changed, 0 insertions(+), 85 deletions(-)
---
diff --git a/data/epiphany.convert b/data/epiphany.convert
index 66b37af..b73024c 100644
--- a/data/epiphany.convert
+++ b/data/epiphany.convert
@@ -3,7 +3,6 @@ user-agent = /apps/epiphany/general/user_agent
 new-windows-in-tabs = /apps/epiphany/general/open_new_windows_in_tab
 automatic-downloads = /apps/epiphany/general/automatic_downloads
 warn-on-close-unsubmitted-data = /apps/epiphany/dialogs/warn_on_close_unsubmitted_data
-middle-click-opens-url = /apps/epiphany/general/middle_click_open_url
 remember-passwords = /apps/epiphany/general/remember_passwords
 keyword-search-url = /apps/epiphany/general/url_search
 managed-network = /apps/epiphany/general/managed_network
diff --git a/data/org.gnome.epiphany.gschema.xml b/data/org.gnome.epiphany.gschema.xml
index c94df5f..becb0a2 100644
--- a/data/org.gnome.epiphany.gschema.xml
+++ b/data/org.gnome.epiphany.gschema.xml
@@ -24,11 +24,6 @@
 			<summary>Automatic downloads</summary>
 			<description>When files cannot be opened by the browser they are automatically downloaded to the download folder and opened with the appropriate application.</description>
 		</key>
-		<key type="b" name="middle-click-opens-url">
-			<default>false</default>
-			<summary>Middle click to open the web page pointed to by the currently selected text</summary>
-			<description>Middle clicking on the main view pane will open the web page pointed to by the currently selected text.</description>
-		</key>
 		<key type="b" name="new-windows-in-tabs">
 			<default>true</default>
 			<summary>Force new windows to be opened in tabs</summary>
diff --git a/lib/ephy-prefs.h b/lib/ephy-prefs.h
index b954583..c390e37 100644
--- a/lib/ephy-prefs.h
+++ b/lib/ephy-prefs.h
@@ -116,7 +116,6 @@ typedef enum
 #define EPHY_PREFS_NEW_WINDOWS_IN_TABS            "new-windows-in-tabs"
 #define EPHY_PREFS_AUTO_DOWNLOADS                 "automatic-downloads"
 #define EPHY_PREFS_WARN_ON_CLOSE_UNSUBMITTED_DATA "warn-on-close-unsubmitted-data"
-#define EPHY_PREFS_MIDDLE_CLICK_OPENS_URL         "middle-click-opens-url"
 #define EPHY_PREFS_REMEMBER_PASSWORDS             "remember-passwords"
 #define EPHY_PREFS_KEYWORD_SEARCH_URL             "keyword-search-url"
 #define EPHY_PREFS_MANAGED_NETWORK                "managed-network"
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 4fd14a9..548df02 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2137,81 +2137,6 @@ save_target_uri (EphyWindow *window,
 	return retval;
 }
 
-typedef struct
-{
-	EphyWindow *window;
-	EphyEmbed *embed;
-} ClipboardTextCBData;
-
-static void
-clipboard_text_received_cb (GtkClipboard *clipboard,
-			    const char *text,
-			    ClipboardTextCBData *data)
-{
-	if (data->embed != NULL && text != NULL)
-	{
-		ephy_link_open (EPHY_LINK (data->window), text, data->embed, 0);
-	}
-
-	if (data->embed != NULL)
-	{
-		EphyEmbed **embed_ptr = &(data->embed);
-		g_object_remove_weak_pointer (G_OBJECT (data->embed), (gpointer *) embed_ptr);
-	}
-
-	g_slice_free (ClipboardTextCBData, data);
-}
-
-static gboolean
-open_selected_url (EphyWindow *window,
-		   WebKitWebView *view,
-		   GdkEventButton *event,
-		   WebKitHitTestResult *hit_test_result)
-{
-	guint context;
-	ClipboardTextCBData *cb_data;
-	EphyEmbed *embed;
-	EphyEmbed **embed_ptr;
-
-	if (!g_settings_get_boolean (EPHY_SETTINGS_MAIN, EPHY_PREFS_MIDDLE_CLICK_OPENS_URL) ||
-	    g_settings_get_boolean (EPHY_SETTINGS_LOCKDOWN, EPHY_PREFS_LOCKDOWN_ARBITRARY_URL))
-	{
-		return FALSE;
-	}
-
-	g_object_get (hit_test_result, "context", &context, NULL);
-
-	LOG ("ephy_window_dom_mouse_click_cb: button %d, context %d, modifier %d (%d:%d)",
-	     event->button, context, event->state, (int)event->x, (int)event->y);
-
-	if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK ||
-	    context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE)
-	{
-		return FALSE;
-	}
-
-	/* See bug #133633 for why we do it this way */
-
-	/* We need to make sure we know if the embed is destroyed
-	 * between requesting the clipboard contents, and receiving
-	 * them.
-	 */
-	embed = EPHY_GET_EMBED_FROM_EPHY_WEB_VIEW (view);
-
-	cb_data = g_slice_new0 (ClipboardTextCBData);
-	cb_data->embed = embed;
-	cb_data->window = window;
-	embed_ptr = &cb_data->embed;
-
-	g_object_add_weak_pointer (G_OBJECT (embed), (gpointer *) embed_ptr);
-
-	gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (embed),
-							      GDK_SELECTION_PRIMARY),
-				    (GtkClipboardTextReceivedFunc) clipboard_text_received_cb,
-				    cb_data);
-	return TRUE;
-}
-
 static gboolean
 ephy_window_dom_mouse_click_cb (WebKitWebView *view,
 				GdkEventButton *event,
@@ -2231,9 +2156,6 @@ ephy_window_dom_mouse_click_cb (WebKitWebView *view,
 	        case GDK_BUTTON_PRIMARY:
 			handled = save_target_uri (window, view, event, hit_test_result);
 			break;
-	        case GDK_BUTTON_MIDDLE:
-			handled = open_selected_url (window, view, event, hit_test_result);
-			break;
 #ifndef HAVE_WEBKIT2
 	        case GDK_BUTTON_SECONDARY:
 			show_embed_popup (window, view, event, hit_test_result);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]