Skip to content

Commit

Permalink
fix hanging mouse in automation & pianoroll (LMMS#4822);
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpblade4 committed Apr 28, 2019
1 parent eee02c2 commit 8a02116
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 7 additions & 3 deletions src/gui/editors/AutomationEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ void AutomationEditor::leaveEvent(QEvent * e )
{
QApplication::restoreOverrideCursor();
}

QWidget::leaveEvent( e );
update();
}


Expand Down Expand Up @@ -1510,8 +1510,12 @@ void AutomationEditor::paintEvent(QPaintEvent * pe )
case SELECT: cursor = s_toolSelect; break;
case MOVE: cursor = s_toolMove; break;
}
p.drawPixmap( mapFromGlobal( QCursor::pos() ) + QPoint( 8, 8 ),
*cursor );
// TODO RON copy all if, replace the top left etc
QPoint mousePosition = mapFromGlobal( QCursor::pos() );
if( cursor != NULL && mousePosition.y() > TOP_MARGIN + SCROLLBAR_SIZE)
{
p.drawPixmap( mousePosition + QPoint( 8, 8 ), *cursor );
}
}


Expand Down
8 changes: 4 additions & 4 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ void PianoRoll::leaveEvent(QEvent * e )

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


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

Expand Down

0 comments on commit 8a02116

Please sign in to comment.