From 68ec89213e4d7c23cb681016b0b627e39fae9e4f Mon Sep 17 00:00:00 2001 From: Marcel Stimberg Date: Sun, 23 Aug 2009 20:40:16 +0000 Subject: When using Drag'n'Drop from Places menu, install a link launcher (.desktop file) instead of copying the entire directory. Bug: https://bugzilla.gnome.org/show_bug.cgi?id=357934 Bug-Ubuntu: https://launchpad.net/bugs/62529 --- mate-panel/menu.c | 5 +++-- mate-panel/menu.h | 3 ++- mate-panel/panel-menu-items.c | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mate-panel/menu.c b/mate-panel/menu.c index 273fae86..b3256842 100644 --- a/mate-panel/menu.c +++ b/mate-panel/menu.c @@ -1211,7 +1211,8 @@ drag_data_get_string_cb (GtkWidget *widget, GdkDragContext *context, void setup_uri_drag (GtkWidget *menuitem, const char *uri, - const char *icon) + const char *icon, + GdkDragAction action) { static GtkTargetEntry menu_item_targets[] = { { "text/uri-list", 0, 0 } @@ -1223,7 +1224,7 @@ setup_uri_drag (GtkWidget *menuitem, gtk_drag_source_set (menuitem, GDK_BUTTON1_MASK|GDK_BUTTON2_MASK, menu_item_targets, 1, - GDK_ACTION_COPY); + action); if (icon != NULL) gtk_drag_source_set_icon_name (menuitem, icon); diff --git a/mate-panel/menu.h b/mate-panel/menu.h index 8638cbb8..628b25cf 100644 --- a/mate-panel/menu.h +++ b/mate-panel/menu.h @@ -53,7 +53,8 @@ void setup_internal_applet_drag (GtkWidget *menuitem, PanelActionButtonType type); void setup_uri_drag (GtkWidget *menuitem, const char *uri, - const char *icon); + const char *icon, + GdkDragAction action); GtkWidget * panel_create_menu (void); diff --git a/mate-panel/panel-menu-items.c b/mate-panel/panel-menu-items.c index 81668dbc..e39fa567 100644 --- a/mate-panel/panel-menu-items.c +++ b/mate-panel/panel-menu-items.c @@ -261,7 +261,7 @@ panel_menu_items_append_from_desktop (GtkWidget *menu, uri = g_filename_to_uri (full_path, NULL, NULL); - setup_uri_drag (item, uri, icon); + setup_uri_drag (item, uri, icon, GDK_ACTION_COPY); g_free (uri); g_key_file_free (key_file); @@ -308,7 +308,8 @@ panel_menu_items_append_place_item (const char *icon_name, g_signal_connect (G_OBJECT (item), "button_press_event", G_CALLBACK (menu_dummy_button_press_event), NULL); - setup_uri_drag (item, uri, icon_name); + if (g_str_has_prefix (uri, "file:")) /*Links only work for local files*/ + setup_uri_drag (item, uri, icon_name, GDK_ACTION_LINK); } static GtkWidget * -- cgit v1.2.1