Fix Dnd from clip-picker on macOS

On macOS, `context->get_targets ()` may be empty when dragging.
In this case the Clip-Picker assumed that a slot is about to
be dropped and switched to the local clip library.

This in turn cleared selection and it was no lnger possible
to drag any clip out of the library.
This commit is contained in:
Robin Gareus 2022-03-01 16:33:39 +01:00
parent 5c701a3673
commit 566596e383
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 11 additions and 8 deletions

View File

@ -566,20 +566,23 @@ TriggerClipPicker::drag_data_get (Glib::RefPtr<Gdk::DragContext> const&, Selecti
}
bool
TriggerClipPicker::drag_motion (Glib::RefPtr<Gdk::DragContext> const& context, int, int y, guint time)
TriggerClipPicker::drag_motion (Glib::RefPtr<Gdk::DragContext> const& context, int, int, guint time)
{
for (auto i : context->get_targets ()) {
if (i == "text/uri-list") {
context->drag_status (Gdk::ACTION_LINK, time);
if (i == "x-ardour/region.pbdid") {
/* prepare for export to local clip library */
if (!_clip_library_dir.empty () && _current_path != _clip_library_dir) {
list_dir (_clip_library_dir);
}
context->drag_status (Gdk::ACTION_COPY, time);
return true;
}
}
if (!_clip_library_dir.empty () && _current_path != _clip_library_dir) {
list_dir (_clip_library_dir);
}
context->drag_status (Gdk::ACTION_COPY, time);
/* drag from clip-picker (to slots), or
* drag of an external folder to the clip-picker (add to sample_lib_path)
*/
context->drag_status (Gdk::ACTION_LINK, time);
return true;
}