summaryrefslogtreecommitdiff
path: root/community/midori/fix-copying.patch
blob: ab358190072339df3b0457f1f49a07c8c099e739 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 28aca95..b33e2e4 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -1041,7 +1041,7 @@ midori_browser_save_uri (MidoriBrowser* browser,
     GtkWidget* dialog;
     const gchar* title = midori_view_get_display_title (view);
     gchar* filename;
-    GList* resources = midori_view_get_subresources (view);
+    GList* resources = midori_view_get_resources (view);
     gboolean file_only = TRUE;
     GtkWidget* checkbox = NULL;
 
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 37cc78f..2c71f55 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -1993,21 +1993,22 @@ midori_web_view_menu_image_new_tab_activate_cb (GtkWidget*  widget,
 }
 
 GList*
-midori_view_get_subresources (MidoriView* view)
+midori_view_get_resources (MidoriView* view)
 {
     WebKitWebView* web_view = WEBKIT_WEB_VIEW (view->web_view);
     WebKitWebFrame* frame = webkit_web_view_get_main_frame (web_view);
     WebKitWebDataSource* data_source = webkit_web_frame_get_data_source (frame);
-    return webkit_web_data_source_get_subresources (data_source);
+    GList* resources = webkit_web_data_source_get_subresources (data_source);
+    return g_list_prepend (resources, webkit_web_data_source_get_main_resource (data_source));
 }
 
 static GString*
 midori_view_get_data_for_uri (MidoriView*  view,
                               const gchar* uri)
 {
-    GList* resources = midori_view_get_subresources (view);
+    GList* resources = midori_view_get_resources (view);
     GList* list;
-    GString* result;
+    GString* result = NULL;
 
     for (list = resources; list; list = g_list_next (list))
     {
@@ -2032,7 +2033,8 @@ midori_view_clipboard_get_image_cb (GtkClipboard*     clipboard,
     MidoriView* view = MIDORI_VIEW (g_object_get_data (user_data, "view"));
     WebKitHitTestResult* hit_test = user_data;
     gchar* uri = katze_object_get_string (hit_test, "image-uri");
-    /* if (gtk_selection_data_targets_include_image (selection_data, TRUE)) */
+
+    if (gtk_targets_include_image(&selection_data->target, 1, TRUE))
     {
         GString* data = midori_view_get_data_for_uri (view, uri);
         if (data != NULL)
@@ -2052,7 +2054,7 @@ midori_view_clipboard_get_image_cb (GtkClipboard*     clipboard,
         else
             g_warn_if_reached ();
     }
-    /* if (gtk_selection_data_targets_include_text (selection_data)) */
+    if (gtk_targets_include_text(&selection_data->target, 1))
         gtk_selection_data_set_text (selection_data, uri, -1);
     g_free (uri);
 }