updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / gnome-panel-ubuntu / 03_dnd_places_link.patch
blob694192c279f542905a7a5e705eb72bef060baa9d
1 Description: When using Drag'n'Drop from Places menu, install a link launcher (.desktop file) instead of copying the entire directory.
2 Author: Marcel Stimberg
3 Bug: https://bugzilla.gnome.org/show_bug.cgi?id=357934
4 Bug-Ubuntu: https://launchpad.net/bugs/62529
6 Index: gnome-panel-2.30.0/gnome-panel/menu.c
7 ===================================================================
8 --- gnome-panel-2.30.0.orig/gnome-panel/menu.c 2010-03-09 00:07:06.000000000 +1100
9 +++ gnome-panel-2.30.0/gnome-panel/menu.c 2010-06-03 13:57:54.293946027 +1000
10 @@ -1213,7 +1213,8 @@
11 void
12 setup_uri_drag (GtkWidget *menuitem,
13 const char *uri,
14 - const char *icon)
15 + const char *icon,
16 + GdkDragAction action)
18 static GtkTargetEntry menu_item_targets[] = {
19 { "text/uri-list", 0, 0 }
20 @@ -1225,7 +1226,7 @@
21 gtk_drag_source_set (menuitem,
22 GDK_BUTTON1_MASK|GDK_BUTTON2_MASK,
23 menu_item_targets, 1,
24 - GDK_ACTION_COPY);
25 + action);
27 if (icon != NULL)
28 gtk_drag_source_set_icon_name (menuitem, icon);
29 Index: gnome-panel-2.30.0/gnome-panel/menu.h
30 ===================================================================
31 --- gnome-panel-2.30.0.orig/gnome-panel/menu.h 2010-01-14 14:26:27.000000000 +1100
32 +++ gnome-panel-2.30.0/gnome-panel/menu.h 2010-06-03 13:57:54.293946027 +1000
33 @@ -51,7 +51,8 @@
34 PanelActionButtonType type);
35 void setup_uri_drag (GtkWidget *menuitem,
36 const char *uri,
37 - const char *icon);
38 + const char *icon,
39 + GdkDragAction action);
41 GtkWidget * panel_create_menu (void);
43 Index: gnome-panel-2.30.0/gnome-panel/panel-menu-items.c
44 ===================================================================
45 --- gnome-panel-2.30.0.orig/gnome-panel/panel-menu-items.c 2010-06-03 13:57:49.626446947 +1000
46 +++ gnome-panel-2.30.0/gnome-panel/panel-menu-items.c 2010-06-03 13:57:54.293946027 +1000
47 @@ -261,7 +261,7 @@
49 uri = g_filename_to_uri (full_path, NULL, NULL);
51 - setup_uri_drag (item, uri, icon);
52 + setup_uri_drag (item, uri, icon, GDK_ACTION_COPY);
53 g_free (uri);
55 g_key_file_free (key_file);
56 @@ -308,7 +308,8 @@
57 g_signal_connect (G_OBJECT (item), "button_press_event",
58 G_CALLBACK (menu_dummy_button_press_event), NULL);
60 - setup_uri_drag (item, uri, icon_name);
61 + if (g_str_has_prefix (uri, "file:")) /*Links only work for local files*/
62 + setup_uri_drag (item, uri, icon_name, GDK_ACTION_LINK);
65 static GtkWidget *