Skip to content

Commit

Permalink
fix hanging mouse in piano roll (LMMS#4822)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpblade4 committed Apr 24, 2019
1 parent 160d306 commit eee02c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/gui/TimeLineWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppt,

m_xOffset -= s_posMarkerPixmap->width() / 2;

setMouseTracking(true);
m_pos.m_timeLine = this;

QTimer * updateTimer = new QTimer( this );
Expand Down Expand Up @@ -365,6 +366,7 @@ void TimeLineWidget::mousePressEvent( QMouseEvent* event )

void TimeLineWidget::mouseMoveEvent( QMouseEvent* event )
{
parentWidget()->update(); // essential for widgets that this timeline had taken their mouse move event from.
const MidiTime t = m_begin + static_cast<int>( qMax( event->x() - m_xOffset - m_moveXOff, 0 ) * MidiTime::ticksPerTact() / m_ppt );

switch( m_action )
Expand Down
3 changes: 2 additions & 1 deletion src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,7 @@ void PianoRoll::leaveEvent(QEvent * e )

QWidget::leaveEvent( e );
s_textFloat->hide();
this->update(); // cleaning inner mouse-related graphics
}


Expand Down Expand Up @@ -3160,7 +3161,7 @@ void PianoRoll::paintEvent(QPaintEvent * pe )
case ModeSelect: cursor = s_toolSelect; break;
case ModeEditDetuning: cursor = s_toolOpen; break;
}
if( cursor != NULL )
if( cursor != NULL && mapFromGlobal( QCursor::pos() ).y() > PR_TOP_MARGIN )
{
p.drawPixmap( mapFromGlobal( QCursor::pos() ) + QPoint( 8, 8 ),
*cursor );
Expand Down

0 comments on commit eee02c2

Please sign in to comment.