diff --git a/src/notation/view/notationviewinputcontroller.cpp b/src/notation/view/notationviewinputcontroller.cpp index ca06a3b27df43..fc480b5403a16 100644 --- a/src/notation/view/notationviewinputcontroller.cpp +++ b/src/notation/view/notationviewinputcontroller.cpp @@ -890,6 +890,12 @@ void NotationViewInputController::handleLeftClickRelease(const QPointF& releaseP return; } + if (m_shouldStartEditOnLeftClickRelease) { + dispatcher()->dispatch("edit-element", ActionData::make_arg1(m_logicalBeginPoint)); + m_shouldStartEditOnLeftClickRelease = false; + return; + } + const INotationInteraction::HitElementContext& ctx = hitElementContext(); if (!ctx.element) { return; @@ -953,16 +959,10 @@ void NotationViewInputController::mouseDoubleClickEvent(QMouseEvent* event) return; } - ActionCode actionCode; - if (hitElement->isMeasure() && event->modifiers() == Qt::NoModifier) { - actionCode = "note-input"; + dispatcher()->dispatch("note-input", ActionData::make_arg1(m_logicalBeginPoint)); } else if (hitElement->isInstrumentName()) { - actionCode = "edit-element"; - } - - if (!actionCode.empty()) { - dispatcher()->dispatch(actionCode, ActionData::make_arg1(m_logicalBeginPoint)); + m_shouldStartEditOnLeftClickRelease = true; } } diff --git a/src/notation/view/notationviewinputcontroller.h b/src/notation/view/notationviewinputcontroller.h index 57a5b49be6f87..98a60fd8b2388 100644 --- a/src/notation/view/notationviewinputcontroller.h +++ b/src/notation/view/notationviewinputcontroller.h @@ -198,6 +198,8 @@ class NotationViewInputController : public muse::actions::Actionable, public mus mu::engraving::EngravingItem* m_prevHitElement = nullptr; mu::engraving::EngravingItem* m_prevSelectedElement = nullptr; + + bool m_shouldStartEditOnLeftClickRelease = false; bool m_shouldTogglePopupOnLeftClickRelease = false; }; }