Clean up DnD, use MIME-types

This is in preparation for allowing to drag trigger-regions
or trigger-slots. Those will not use a static singleton
PublicEditor API.

Additionally this constrains Ardour-internal drags to Ardour
(via Gtk::TARGET_SAME_APP).
This commit is contained in:
Robin Gareus 2022-01-10 21:29:29 +01:00
parent 1078dc7eda
commit 056189c76c
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
10 changed files with 32 additions and 28 deletions

View file

@ -268,8 +268,8 @@ Editor::initialize_canvas ()
vector<TargetEntry> target_table;
target_table.push_back (TargetEntry ("regions")); // DnD from the region list will generate this target
target_table.push_back (TargetEntry ("sources")); // DnD from the source list will generate this target
target_table.push_back (TargetEntry ("x-ardour/region.erl", TARGET_SAME_APP)); // DnD from the region list will generate this target
target_table.push_back (TargetEntry ("x-ardour/region.esl", TARGET_SAME_APP)); // DnD from the source list will generate this target
target_table.push_back (TargetEntry ("text/uri-list"));
target_table.push_back (TargetEntry ("text/plain"));
target_table.push_back (TargetEntry ("application/x-rootwin-drop"));
@ -391,9 +391,9 @@ Editor::track_canvas_drag_data_received (const RefPtr<Gdk::DragContext>& context
if (!ARDOUR_UI_UTILS::engine_is_running ()) {
return;
}
if (data.get_target() == X_("regions")) {
if (data.get_target() == "x-ardour/region.erl") {
drop_regions (context, x, y, data, info, time, true);
} else if (data.get_target() == X_("sources")) {
} else if (data.get_target() == "x-ardour/region.esl") {
drop_regions (context, x, y, data, info, time, false);
} else {
drop_paths (context, x, y, data, info, time);