diff options
author | Robin Gareus <robin@gareus.org> | 2016-04-07 19:40:54 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-04-07 19:40:54 +0200 |
commit | 2e38195e5c9a0f73519c4a44957fd11e0cdeffca (patch) | |
tree | 6aaef73e4d82d8ef3a6f7254ebe5a1d0830eccf7 /gtk2_ardour/plugin_pin_dialog.cc | |
parent | 01251e7e14bba0b4604618ccfad87361e32dac18 (diff) |
fix wire DnD (for thru connections)
Diffstat (limited to 'gtk2_ardour/plugin_pin_dialog.cc')
-rw-r--r-- | gtk2_ardour/plugin_pin_dialog.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gtk2_ardour/plugin_pin_dialog.cc b/gtk2_ardour/plugin_pin_dialog.cc index 0096f8d913..1aa35fc9c9 100644 --- a/gtk2_ardour/plugin_pin_dialog.cc +++ b/gtk2_ardour/plugin_pin_dialog.cc @@ -848,16 +848,19 @@ PluginPinDialog::darea_size_allocate (Gtk::Allocation&) } bool -PluginPinDialog::drag_type_matches (CtrlType ct) { +PluginPinDialog::drag_type_matches (const CtrlElem& e) { if (!_dragging || !_selection) { return true; } - if (_selection->ct == Input && ct == Sink) { return true; } - if (_selection->ct == Sink && ct == Input) { return true; } - if (_selection->ct == Output && ct == Source) { return true; } - if (_selection->ct == Source && ct == Output) { return true; } - if (_selection->ct == Input && ct == Output) { return true; } - if (_selection->ct == Output && ct == Input) { return true; } + if (_selection->dt != e->dt) { + return false; + } + if (_selection->ct == Input && e->ct == Sink) { return true; } + if (_selection->ct == Sink && e->ct == Input) { return true; } + if (_selection->ct == Output && e->ct == Source) { return true; } + if (_selection->ct == Source && e->ct == Output) { return true; } + if (_selection->ct == Input && e->ct == Output) { return true; } + if (_selection->ct == Output && e->ct == Input) { return true; } return false; } @@ -868,7 +871,8 @@ PluginPinDialog::darea_motion_notify_event (GdkEventMotion* ev) _hover.reset (); for (CtrlElemList::iterator i = _elements.begin (); i != _elements.end (); ++i) { if (ev->x >= i->x && ev->x <= i->x + i->w - && ev->y >= i->y && ev->y <= i->y + i->h && drag_type_matches (i->e->ct)) + && ev->y >= i->y && ev->y <= i->y + i->h + && drag_type_matches (i->e)) { if (!i->prelight) changed = true; i->prelight = true; |