[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))

Денис Песоцкий denis at kde.ru
Tue Feb 1 01:47:33 CET 2011


Fuck sake :)
Following happens when mouse is wrapped:
1) QCursor::setPos(new_pos)
2) mouseGrabPos = new_pos
So absDelta will be ok. I'll mark corresponding lines, look:

                     if ( mousePos.y() <= mouseContainer.top() + 4
                         && verticalScrollBar()->value() <
verticalScrollBar()->maximum() - 10 )
                     {
                         mousePos.setY( mouseContainer.bottom() - 5 ); //!!!!!
                         QCursor::setPos( mousePos );
                     }
                     // wrap mouse from bottom to top
                     else if ( mousePos.y() >= mouseContainer.bottom() - 4
                                && verticalScrollBar()->value() > 10 )
                     {
                         mousePos.setY( mouseContainer.top() + 5 ); //!!!!!!
                         QCursor::setPos( mousePos );
                     }
                     // remember last position
                     d->mouseGrabPos = mousePos; //!!!!!!!!!!!!!!!!!!!!!!!

At last line it remembers new mouse pos. So next delta will be good delta...


More information about the Okular-devel mailing list