Skip to content

Commit 653f38d

Browse files
Merge pull request #31503 from RomanPudashkin/sound_preview_note_input
[4.6.5] Avoid double seek when entering notes
2 parents b719219 + b1de009 commit 653f38d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/notation/view/notationviewinputcontroller.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ void NotationViewInputController::mousePressEvent(QMouseEvent* event)
691691

692692
// note enter mode
693693
if (m_view->isNoteEnterMode()) {
694-
handleClickInNoteInputMode(event);
694+
handleClickInNoteInputMode(event, shouldSeek);
695695
return;
696696
}
697697

@@ -754,7 +754,7 @@ void NotationViewInputController::mousePressEvent(QMouseEvent* event)
754754
}
755755
}
756756

757-
void NotationViewInputController::handleClickInNoteInputMode(QMouseEvent* event)
757+
void NotationViewInputController::handleClickInNoteInputMode(QMouseEvent* event, bool& shouldSeek)
758758
{
759759
const PointF logicPos = m_view->toLogical(event->pos());
760760

@@ -768,6 +768,7 @@ void NotationViewInputController::handleClickInNoteInputMode(QMouseEvent* event)
768768
const bool replace = keyState & Qt::ShiftModifier;
769769
const bool insert = keyState & Qt::ControlModifier;
770770
dispatcher()->dispatch("put-note", ActionData::make_arg3<PointF, bool, bool>(logicPos, replace, insert));
771+
shouldSeek = false;
771772
}
772773

773774
bool NotationViewInputController::mousePress_considerGrip(const ClickContext& ctx)

src/notation/view/notationviewinputcontroller.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class NotationViewInputController : public muse::actions::Actionable, public mus
187187
bool isHitGrip = false;
188188
};
189189

190-
void handleClickInNoteInputMode(QMouseEvent* event);
190+
void handleClickInNoteInputMode(QMouseEvent* event, bool& shouldSeek);
191191
bool mousePress_considerGrip(const ClickContext& ctx); // returns true if event is consumed
192192
bool mousePress_considerDragOutgoingElement(const ClickContext& ctx);
193193
void mousePress_considerSelect(const ClickContext& ctx);

0 commit comments

Comments
 (0)