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

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


>> Ok, I'm here.
>> It can happen in 2 cases:
>> 1) Mouse is moved by more than (screen height)/2 vetically between
>> event loops. I did that with my thinkpoint and it drags not as
>> excepted if I move cursor fast.
> Hmm, this is unfortunate we really never though that could be possible, are
> you really able to reproduce this easily?
Yes i do. If I press my trackpoint firm enought, it happens.
I think, you can repdroduce it with mouse, if make high enought sensitivity.

>> 2) Cursor had wrapped somewhere in other place of code. If it wraps
>> here, it will do d->mouseGrabPos = mousePos; anyway. As I can see, it
>> can also wrap while zooming, but it can it happen in the same time it
>> is draggin?
> Yes, just drag drag the mouse to the bottom of the screen and continue
> dragging and see what happens.

I know :). Look at your code:

                    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;

It remembers new mouse position anyways. Ever if it wrapped,
mouseGrabPos corresponds to it. That's why there is no need to check
if it wrapped last time.

Now you understand me?


More information about the Okular-devel mailing list