[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
So you don't accept that fix? I mean this: http://paste.kde.org/4508/ ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
Here it is. Also created constant for wrap margin, IMHO it looks better. 2011/2/11 Albert Astals Cid aa...@kde.org: A Divendres, 11 de febrer de 2011, Денис Песоцкий va escriure: So you don't accept that fix? I mean this: http://paste.kde.org/4508/ Have been busy and did not really have time to review your code yet. Sorry about that. Could you please send the patch as an attachment to the list instead of putting in paste.kde.org? This way it will be accessible in the future and not only for a while. Thanks and sorry again, Albert ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel Index: ui/pageview.cpp === --- ui/pageview.cpp (revision 1219793) +++ ui/pageview.cpp (working copy) @@ -1445,20 +1445,22 @@ const int absDeltaY = abs(deltaY); if ( absDeltaY mouseContainer.height() / 2 ) { -deltaY = mouseContainer.height() - absDeltaY; +deltaY = d-mouseMidLastY - QCursor::pos().y(); } -if ( mouseY = mouseContainer.top() + 4 +static const int wrap_margin = 5; + +if ( mouseY mouseContainer.top() + wrap_margin d-zoomFactor 3.99 ) { -mouseY = mouseContainer.bottom() - 5; +mouseY = mouseContainer.bottom() - wrap_margin; QCursor::setPos( e-globalPos().x(), mouseY ); } // wrap mouse from bottom to top -else if ( mouseY = mouseContainer.bottom() - 4 +else if ( mouseY mouseContainer.bottom() - wrap_margin d-zoomFactor 0.11 ) { -mouseY = mouseContainer.top() + 5; +mouseY = mouseContainer.top() + wrap_margin; QCursor::setPos( e-globalPos().x(), mouseY ); } // remember last position @@ -1528,27 +1530,28 @@ // wrap mouse from top to bottom const QRect mouseContainer = KGlobalSettings::desktopGeometry( this ); -// If the delta is huge it probably means we just wrapped in that direction +// If the delta is huge it probably means we just wrapped in that direction and Qt sent bad event const QPoint absDelta(abs(delta.x()), abs(delta.y())); if ( absDelta.y() mouseContainer.height() / 2 ) { -delta.setY(mouseContainer.height() - absDelta.y()); +delta.setY(d-mouseGrabPos.y() - QCursor::pos().y()); } if ( absDelta.x() mouseContainer.width() / 2 ) { -delta.setX(mouseContainer.width() - absDelta.x()); +delta.setX(d-mouseGrabPos.x() - QCursor::pos().x()); } -if ( mousePos.y() = mouseContainer.top() + 4 - verticalScrollBar()-value() verticalScrollBar()-maximum() - 10 ) +static const int wrap_margin = 5; +if ( mousePos.y() mouseContainer.top() + wrap_margin + verticalScrollBar()-value() verticalScrollBar()-maximum() - 2 * wrap_margin ) { -mousePos.setY( mouseContainer.bottom() - 5 ); +mousePos.setY( mouseContainer.bottom() - wrap_margin ); QCursor::setPos( mousePos ); } // wrap mouse from bottom to top -else if ( mousePos.y() = mouseContainer.bottom() - 4 - verticalScrollBar()-value() 10 ) +else if ( mousePos.y() mouseContainer.bottom() - wrap_margin + verticalScrollBar()-value() 2 * wrap_margin ) { -mousePos.setY( mouseContainer.top() + 5 ); +mousePos.setY( mouseContainer.top() + wrap_margin ); QCursor::setPos( mousePos ); } // remember last position ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
Code with QCursor::pos() works ok with any panel position, tested it on 2 PCs. ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: Fuck sake :) Control your language 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... Yes, i know, but empirical experience says that without the lines above bad things happen, check the svn logs, maybe they are uncovering a bug somewhere else though. Albert ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: There is also hardcoded margin. Here is better code (added margin and removed stupid check): Again, please control your language. else if ( !d-mouseGrabPos.isNull() ) { setCursor( Qt::SizeAllCursor ); QPoint mousePos = e-globalPos(); QPoint delta = d-mouseGrabPos - mousePos; const QRect mouseContainer = KGlobalSettings::desktopGeometry( this ); static const int margin = 5; // wrap mouse from top to bottom if ( mousePos.y() mouseContainer.top() + margin verticalScrollBar()-value() verticalScrollBar()-maximum() - 2*margin ) { mousePos.setY( mouseContainer.bottom() - margin ); QCursor::setPos( mousePos ); } // wrap mouse from bottom to top else if ( mousePos.y() mouseContainer.bottom() - margin verticalScrollBar()-value() 2*margin ) { mousePos.setY( mouseContainer.top() + margin ); QCursor::setPos( mousePos ); } // remember last position d-mouseGrabPos = mousePos; // scroll page by position increment horizontalScrollBar()-setValue(horizontalScrollBar()-value() + delta.x()); verticalScrollBar()-setValue(verticalScrollBar()-value() + delta.y()); } } As said in the other mail, check the svn logs and make sure your fix does not break what the other code was supposed to fix. Albert ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
As said in the other mail, check the svn logs and make sure your fix does not break what the other code was supposed to fix. Ok, I found that commit: http://websvn.kde.org/?view=revisionrevision=1156337 Anyway, I can't understand what for it is needed and did he fixed anything. Because any time it wraps, It saves new mouse position, it is obvious. Please debug that blocks. I can't because I don't know how to build it. Control your language Sorry for that. ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: As said in the other mail, check the svn logs and make sure your fix does not break what the other code was supposed to fix. Ok, I found that commit: http://websvn.kde.org/?view=revisionrevision=1156337 Anyway, I can't understand what for it is needed and did he fixed anything. Because any time it wraps, It saves new mouse position, it is obvious. Please debug that blocks. I can't because I don't know how to build it. http://okular.kde.org/download.php Albert Control your language Sorry for that. ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
Yes, I've tried that. I make changes to ui/pageview.cpp, recompile it, start ./shell/okular and it works like nothing happend. Ever if I don't create d-pointer in constructor. Probably it loads that lib dynamically from my system. 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: As said in the other mail, check the svn logs and make sure your fix does not break what the other code was supposed to fix. Ok, I found that commit: http://websvn.kde.org/?view=revisionrevision=1156337 Anyway, I can't understand what for it is needed and did he fixed anything. Because any time it wraps, It saves new mouse position, it is obvious. Please debug that blocks. I can't because I don't know how to build it. http://okular.kde.org/download.php Albert Control your language Sorry for that. ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: Yes, I've tried that. I make changes to ui/pageview.cpp, recompile it, start ./shell/okular and it works like nothing happend. Ever if I don't create d-pointer in constructor. Probably it loads that lib dynamically from my system. That's the part when you read the page again and see If you install Okular in a different path than your system kde4 install directory it is possible that you need to run export KDEDIRS=/path/to/where/you/installed/okular:$(kde4-config --prefix) kbuildsycoca4 so that the correct Okular instance and libraries are picked up Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: As said in the other mail, check the svn logs and make sure your fix does not break what the other code was supposed to fix. Ok, I found that commit: http://websvn.kde.org/?view=revisionrevision=1156337 Anyway, I can't understand what for it is needed and did he fixed anything. Because any time it wraps, It saves new mouse position, it is obvious. Please debug that blocks. I can't because I don't know how to build it. http://okular.kde.org/download.php Albert Control your language Sorry for that. ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
obey@damnbook okular % pwd /home/obey/tmp/kdegraphics/build/okular obey@damnbook okular % export KDEDIRS=$(pwd):$(kde4-config --prefix) obey@damnbook okular % kbuildsycoca4 kbuildsycoca4 running... obey@damnbook okular % ./shell/okular ~/Downloads/Deluge/c_cpp_standards/c_iso_iec_9899_1999.pdf And it work like I've not changed anything (y, ofc I recompiled it). 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: Yes, I've tried that. I make changes to ui/pageview.cpp, recompile it, start ./shell/okular and it works like nothing happend. Ever if I don't create d-pointer in constructor. Probably it loads that lib dynamically from my system. That's the part when you read the page again and see If you install Okular in a different path than your system kde4 install directory it is possible that you need to run export KDEDIRS=/path/to/where/you/installed/okular:$(kde4-config --prefix) kbuildsycoca4 so that the correct Okular instance and libraries are picked up Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: As said in the other mail, check the svn logs and make sure your fix does not break what the other code was supposed to fix. Ok, I found that commit: http://websvn.kde.org/?view=revisionrevision=1156337 Anyway, I can't understand what for it is needed and did he fixed anything. Because any time it wraps, It saves new mouse position, it is obvious. Please debug that blocks. I can't because I don't know how to build it. http://okular.kde.org/download.php Albert Control your language Sorry for that. ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: obey@damnbook okular % pwd /home/obey/tmp/kdegraphics/build/okular obey@damnbook okular % export KDEDIRS=$(pwd):$(kde4-config --prefix) obey@damnbook okular % kbuildsycoca4 kbuildsycoca4 running... obey@damnbook okular % ./shell/okular ~/Downloads/Deluge/c_cpp_standards/c_iso_iec_9899_1999.pdf And it work like I've not changed anything (y, ofc I recompiled it). You have to install it, even if it is in home/obey/tmp/kdegraphics/install You can not run it from the build dir Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: Yes, I've tried that. I make changes to ui/pageview.cpp, recompile it, start ./shell/okular and it works like nothing happend. Ever if I don't create d-pointer in constructor. Probably it loads that lib dynamically from my system. That's the part when you read the page again and see If you install Okular in a different path than your system kde4 install directory it is possible that you need to run export KDEDIRS=/path/to/where/you/installed/okular:$(kde4-config --prefix) kbuildsycoca4 so that the correct Okular instance and libraries are picked up Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: As said in the other mail, check the svn logs and make sure your fix does not break what the other code was supposed to fix. Ok, I found that commit: http://websvn.kde.org/?view=revisionrevision=1156337 Anyway, I can't understand what for it is needed and did he fixed anything. Because any time it wraps, It saves new mouse position, it is obvious. Please debug that blocks. I can't because I don't know how to build it. http://okular.kde.org/download.php Albert Control your language Sorry for that. ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
Thank you, now it works. Inserted qDebug messages in that ifs about absDelta. They happen only if I scroll very fast (as excepted — mouse moves fast, so delta is high). And, as I said, moving cursor fast leads to wrong scrolling. When I removed that blocks, it works as excepted. When I added my margin, it still works as excepted. There is also same absDelta code in zoom, but it can be removed too, logic there is absolutely same — mousePose is always real last pos. I also tested scrolling with mouse wrapping in 2 directions with same algorithm in my app, it works as excepted too. So that absDelta is noot needed. And it was obvious from code :S. 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: obey@damnbook okular % pwd /home/obey/tmp/kdegraphics/build/okular obey@damnbook okular % export KDEDIRS=$(pwd):$(kde4-config --prefix) obey@damnbook okular % kbuildsycoca4 kbuildsycoca4 running... obey@damnbook okular % ./shell/okular ~/Downloads/Deluge/c_cpp_standards/c_iso_iec_9899_1999.pdf And it work like I've not changed anything (y, ofc I recompiled it). You have to install it, even if it is in home/obey/tmp/kdegraphics/install You can not run it from the build dir Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: Yes, I've tried that. I make changes to ui/pageview.cpp, recompile it, start ./shell/okular and it works like nothing happend. Ever if I don't create d-pointer in constructor. Probably it loads that lib dynamically from my system. That's the part when you read the page again and see If you install Okular in a different path than your system kde4 install directory it is possible that you need to run export KDEDIRS=/path/to/where/you/installed/okular:$(kde4-config --prefix) kbuildsycoca4 so that the correct Okular instance and libraries are picked up Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: As said in the other mail, check the svn logs and make sure your fix does not break what the other code was supposed to fix. Ok, I found that commit: http://websvn.kde.org/?view=revisionrevision=1156337 Anyway, I can't understand what for it is needed and did he fixed anything. Because any time it wraps, It saves new mouse position, it is obvious. Please debug that blocks. I can't because I don't know how to build it. http://okular.kde.org/download.php Albert Control your language Sorry for that. ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: Thank you, now it works. Inserted qDebug messages in that ifs about absDelta. They happen only if I scroll very fast (as excepted — mouse moves fast, so delta is high). And, as I said, moving cursor fast leads to wrong scrolling. When I removed that blocks, it works as excepted. When I added my margin, it still works as excepted. There is also same absDelta code in zoom, but it can be removed too, logic there is absolutely same — mousePose is always real last pos. I also tested scrolling with mouse wrapping in 2 directions with same algorithm in my app, it works as excepted too. So that absDelta is noot needed. And it was obvious from code :S. You are not testing the issue that bug fixes, are you? Put your plasma panel on the left and/or at the top and then try again. And check if scrolling with mouse wrapping still works. Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: obey@damnbook okular % pwd /home/obey/tmp/kdegraphics/build/okular obey@damnbook okular % export KDEDIRS=$(pwd):$(kde4-config --prefix) obey@damnbook okular % kbuildsycoca4 kbuildsycoca4 running... obey@damnbook okular % ./shell/okular ~/Downloads/Deluge/c_cpp_standards/c_iso_iec_9899_1999.pdf And it work like I've not changed anything (y, ofc I recompiled it). You have to install it, even if it is in home/obey/tmp/kdegraphics/install You can not run it from the build dir Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: Yes, I've tried that. I make changes to ui/pageview.cpp, recompile it, start ./shell/okular and it works like nothing happend. Ever if I don't create d-pointer in constructor. Probably it loads that lib dynamically from my system. That's the part when you read the page again and see If you install Okular in a different path than your system kde4 install directory it is possible that you need to run export KDEDIRS=/path/to/where/you/installed/okular:$(kde4-config --prefix) kbuildsycoca4 so that the correct Okular instance and libraries are picked up Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: As said in the other mail, check the svn logs and make sure your fix does not break what the other code was supposed to fix. Ok, I found that commit: http://websvn.kde.org/?view=revisionrevision=1156337 Anyway, I can't understand what for it is needed and did he fixed anything. Because any time it wraps, It saves new mouse position, it is obvious. Please debug that blocks. I can't because I don't know how to build it. http://okular.kde.org/download.php Albert Control your language Sorry for that. ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
revision 1156337 hasn't any bug reference in annotation, what ar you talking about? 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: Thank you, now it works. Inserted qDebug messages in that ifs about absDelta. They happen only if I scroll very fast (as excepted — mouse moves fast, so delta is high). And, as I said, moving cursor fast leads to wrong scrolling. When I removed that blocks, it works as excepted. When I added my margin, it still works as excepted. There is also same absDelta code in zoom, but it can be removed too, logic there is absolutely same — mousePose is always real last pos. I also tested scrolling with mouse wrapping in 2 directions with same algorithm in my app, it works as excepted too. So that absDelta is noot needed. And it was obvious from code :S. You are not testing the issue that bug fixes, are you? Put your plasma panel on the left and/or at the top and then try again. And check if scrolling with mouse wrapping still works. Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: obey@damnbook okular % pwd /home/obey/tmp/kdegraphics/build/okular obey@damnbook okular % export KDEDIRS=$(pwd):$(kde4-config --prefix) obey@damnbook okular % kbuildsycoca4 kbuildsycoca4 running... obey@damnbook okular % ./shell/okular ~/Downloads/Deluge/c_cpp_standards/c_iso_iec_9899_1999.pdf And it work like I've not changed anything (y, ofc I recompiled it). You have to install it, even if it is in home/obey/tmp/kdegraphics/install You can not run it from the build dir Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: Yes, I've tried that. I make changes to ui/pageview.cpp, recompile it, start ./shell/okular and it works like nothing happend. Ever if I don't create d-pointer in constructor. Probably it loads that lib dynamically from my system. That's the part when you read the page again and see If you install Okular in a different path than your system kde4 install directory it is possible that you need to run export KDEDIRS=/path/to/where/you/installed/okular:$(kde4-config --prefix) kbuildsycoca4 so that the correct Okular instance and libraries are picked up Albert 2011/2/2 Albert Astals Cid aa...@kde.org: A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: As said in the other mail, check the svn logs and make sure your fix does not break what the other code was supposed to fix. Ok, I found that commit: http://websvn.kde.org/?view=revisionrevision=1156337 Anyway, I can't understand what for it is needed and did he fixed anything. Because any time it wraps, It saves new mouse position, it is obvious. Please debug that blocks. I can't because I don't know how to build it. http://okular.kde.org/download.php Albert Control your language Sorry for that. ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
Sorry about that. I don't have any experience with big OSS projects collaborative development (except kde-l10n, where we don't need to care about revisions, diffs, ...). Yes, it happens when panel is at top (following is logged after I commented out delta fix): http://paste.kde.org/3932/ IMHO better solution: use QCursor::pos() to recalculate real delta if we enter into one of that blocks related to absDelta. This must also solve false triggering if it when mouse is rapidly moved. Something like that: QPoint mousePos = e-globalPos(); QPoint delta = d-mouseGrabPos - mousePos; // wrap mouse from top to bottom const QRect mouseContainer = KGlobalSettings::desktopGeometry( this ); // If the delta is huge it probably means we just wrapped in that direction const QPoint absDelta(abs(delta.x()), abs(delta.y())); if ( absDelta.y() mouseContainer.height() / 2 ) { delta.setY(d-mouseGrabPos.y() - QCursor::pos.y()); } if ( absDelta.x() mouseContainer.width() / 2 ) { delta.setX(d-mouseGrabPos.x() - QCursor::pos.x()); } What do you think? ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
QCursor::pos().x() and QCursor::pos().y(), I mean (typed in mailer). Now tested this solution. It works well. ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
And, by the way, why it happens? Is it Qt bug? ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
if ( absDelta.y() mouseContainer.height() / 2 ) happens not when you move the mouse very fast but when cursor wraps from the top to the bottom of the screen as the comment says. Anyway if you wish to continue discussing this please subscribe to okular-devel mailing list and post there. 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. 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? ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: if ( absDelta.y() mouseContainer.height() / 2 ) happens not when you move the mouse very fast but when cursor wraps from the top to the bottom of the screen as the comment says. Anyway if you wish to continue discussing this please subscribe to okular-devel mailing list and post there. 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? 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. Albert ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
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? ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
A Dimarts, 1 de febrer de 2011, Денис Песоцкий va escriure: 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. Yes, it does remember the position, so let's see what will happen on the next mouse move. The new position (mousePos) will be (0,0) and the old (mouseGrabPos) will be (800, 0) so when you calculate the absolute difference (absDelta) it will be 800 pixels, right? Now you understand me? Not really. Albert ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel
[Okular-devel] Re: About 265002 (Unreachable code in okular/ui/pageview.cpp (related to drag scroll))
There is also hardcoded margin. Here is better code (added margin and removed stupid check): else if ( !d-mouseGrabPos.isNull() ) { setCursor( Qt::SizeAllCursor ); QPoint mousePos = e-globalPos(); QPoint delta = d-mouseGrabPos - mousePos; const QRect mouseContainer = KGlobalSettings::desktopGeometry( this ); static const int margin = 5; // wrap mouse from top to bottom if ( mousePos.y() mouseContainer.top() + margin verticalScrollBar()-value() verticalScrollBar()-maximum() - 2*margin ) { mousePos.setY( mouseContainer.bottom() - margin ); QCursor::setPos( mousePos ); } // wrap mouse from bottom to top else if ( mousePos.y() mouseContainer.bottom() - margin verticalScrollBar()-value() 2*margin ) { mousePos.setY( mouseContainer.top() + margin ); QCursor::setPos( mousePos ); } // remember last position d-mouseGrabPos = mousePos; // scroll page by position increment horizontalScrollBar()-setValue(horizontalScrollBar()-value() + delta.x()); verticalScrollBar()-setValue(verticalScrollBar()-value() + delta.y()); } } ___ Okular-devel mailing list Okular-devel@kde.org https://mail.kde.org/mailman/listinfo/okular-devel