diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-04-13 22:30:05 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-04-13 22:30:05 +0200 |
commit | 04721a12a2a9f198d590c2bd4347f5d522ccf537 (patch) | |
tree | f1c1520a34c4d9cd8db8cfeb10954499d7281a95 /plugins/gtkui | |
parent | 779c28b5130be412d007ba5647bbf190341d722b (diff) |
minor tweaks to dragndrop
Diffstat (limited to 'plugins/gtkui')
-rw-r--r-- | plugins/gtkui/ddblistview.c | 12 | ||||
-rw-r--r-- | plugins/gtkui/ddbtabstrip.c | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/plugins/gtkui/ddblistview.c b/plugins/gtkui/ddblistview.c index 43a2f545..8ffebc74 100644 --- a/plugins/gtkui/ddblistview.c +++ b/plugins/gtkui/ddblistview.c @@ -517,11 +517,9 @@ ddb_listview_list_realize (GtkWidget *widget, { GtkTargetEntry entry = { .target = "STRING", - .flags = GTK_TARGET_SAME_WIDGET/* | GTK_TARGET_OTHER_APP*/, + .flags = GTK_TARGET_SAME_APP, TARGET_SAMEWIDGET }; - // setup drag-drop source -// gtk_drag_source_set (widget, GDK_BUTTON1_MASK, &entry, 1, GDK_ACTION_MOVE); // setup drag-drop target gtk_drag_dest_set (widget, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, &entry, 1, GDK_ACTION_COPY | GDK_ACTION_MOVE); gtk_drag_dest_add_uri_targets (widget); @@ -791,6 +789,12 @@ ddb_listview_list_drag_motion (GtkWidget *widget, { DdbListview *pl = DDB_LISTVIEW (gtk_object_get_data (GTK_OBJECT (widget), "owner")); ddb_listview_list_track_dragdrop (pl, y); + if (pl->drag_source_playlist != deadbeef->plt_get_curr ()) { + gdk_drag_status (drag_context, GDK_ACTION_COPY, time); + } + else { + gdk_drag_status (drag_context, GDK_ACTION_MOVE, time); + } return FALSE; } @@ -1574,7 +1578,7 @@ ddb_listview_list_mousemove (DdbListview *ps, GdkEventMotion *ev, int ex, int ey .info = TARGET_SAMEWIDGET }; GtkTargetList *lst = gtk_target_list_new (&entry, 1); - gtk_drag_begin (widget, lst, GDK_ACTION_MOVE, TARGET_SAMEWIDGET, (GdkEvent *)ev); + gtk_drag_begin (widget, lst, GDK_ACTION_COPY | GDK_ACTION_MOVE, 1, (GdkEvent *)ev); } } else if (ps->areaselect) { diff --git a/plugins/gtkui/ddbtabstrip.c b/plugins/gtkui/ddbtabstrip.c index de6a906f..c228f1e1 100644 --- a/plugins/gtkui/ddbtabstrip.c +++ b/plugins/gtkui/ddbtabstrip.c @@ -91,10 +91,10 @@ ddb_tabstrip_realize (GtkWidget *widget) { ddb_tabstrip_send_configure (DDB_TABSTRIP (widget)); GtkTargetEntry entry = { .target = "STRING", - .flags = GTK_TARGET_SAME_WIDGET | GTK_TARGET_OTHER_APP, + .flags = GTK_TARGET_SAME_APP, 0 }; - gtk_drag_dest_set (widget, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, &entry, 1, GDK_ACTION_COPY); + gtk_drag_dest_set (widget, GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, &entry, 1, GDK_ACTION_COPY | GDK_ACTION_MOVE); gtk_drag_dest_set_track_motion (widget, TRUE); } |