Commit e084fbc7 authored by Albert Astals Cid's avatar Albert Astals Cid

Accept slight pixel movements for detecting mouse clicks

Should help with bug 263314
BUGS: 263314

svn path=/trunk/KDE/kdegraphics/okular/; revision=1216390
parent 6f3667b9
......@@ -1804,9 +1804,12 @@ void PageView::mouseReleaseEvent( QMouseEvent * e )
updateCursor( eventPos );
PageViewItem * pageItem = pickItemOnPoint( eventPos.x(), eventPos.y() );
const QPoint pressPos = contentAreaPoint( mapFromGlobal( d->mousePressPos ) );
const PageViewItem * pageItemPressPos = pickItemOnPoint( pressPos.x(), pressPos.y() );
// if the mouse has not moved since the press, that's a -click-
if ( leftButton && pageItem && d->mousePressPos == e->globalPos())
if ( leftButton && pageItem && pageItem == pageItemPressPos &&
( (d->mousePressPos - e->globalPos()).manhattanLength() < QApplication::startDragDistance() ) )
{
double nX = pageItem->absToPageX(eventPos.x());
double nY = pageItem->absToPageY(eventPos.y());
......@@ -1869,7 +1872,8 @@ void PageView::mouseReleaseEvent( QMouseEvent * e )
}
else if ( rightButton )
{
if ( pageItem && d->mousePressPos == e->globalPos() )
if ( pageItem && pageItem == pageItemPressPos &&
( (d->mousePressPos - e->globalPos()).manhattanLength() < QApplication::startDragDistance() ) )
{
double nX = pageItem->absToPageX(eventPos.x());
double nY = pageItem->absToPageY(eventPos.y());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment