diff options
author | Marcel Stimberg <[email protected]> | 2009-08-23 20:40:16 +0000 |
---|---|---|
committer | Benjamin Valentin <[email protected]> | 2012-03-26 23:49:25 +0200 |
commit | 68ec89213e4d7c23cb681016b0b627e39fae9e4f (patch) | |
tree | e581c9ca56d38d3fbd92d10caeeee646143df52c | |
parent | ab55bf3e46ccab95d268bf0e10dce2e15294cabf (diff) | |
download | mate-panel-68ec89213e4d7c23cb681016b0b627e39fae9e4f.tar.bz2 mate-panel-68ec89213e4d7c23cb681016b0b627e39fae9e4f.tar.xz |
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
-rw-r--r-- | mate-panel/menu.c | 5 | ||||
-rw-r--r-- | mate-panel/menu.h | 3 | ||||
-rw-r--r-- | 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 * |